feat(flutter): GoRouter shell + version gate + auth-aware redirects

Cold launch flow: no server-url -> /server-url. URL set, no token ->
/login. Token present -> /home with shell. VersionGate runs once when
the URL changes, hits /healthz, blocks if min_client_version > package
version. /home is a placeholder until Task 14.

Replaces Navigator.pushReplacementNamed in server_url_screen +
login_screen with context.go now that go_router owns the routes.
This commit is contained in:
2026-05-02 17:24:08 -04:00
parent 9cbbfcff6c
commit d115c267f4
6 changed files with 144 additions and 13 deletions
+7 -6
View File
@@ -1,18 +1,19 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'shared/routing.dart';
import 'theme/theme_data.dart';
class MinstrelApp extends StatelessWidget {
class MinstrelApp extends ConsumerWidget {
const MinstrelApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
Widget build(BuildContext context, WidgetRef ref) {
final router = buildRouter(ref);
return MaterialApp.router(
title: 'Minstrel',
theme: buildThemeData(),
home: const Scaffold(
body: Center(child: Text('Minstrel — scaffold')),
),
routerConfig: router,
);
}
}