- expose legal links to screen readers on web - allow only http(s) legal URLs, prevent double submit - detect transport errors without runtimeType, keep extra in memory - ship third-party license text, document decisions Refs #1 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
32 lines
1.1 KiB
Dart
32 lines
1.1 KiB
Dart
import 'package:go_router/go_router.dart';
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
import 'package:shuffle/core/routing/app_routes.dart';
|
|
import 'package:shuffle/core/routing/not_found_screen.dart';
|
|
import 'package:shuffle/core/routing/redirect_source.dart';
|
|
import 'package:shuffle/core/routing/volatile_extra_codec.dart';
|
|
import 'package:shuffle/features/auth/presentation/auth_routes.dart';
|
|
import 'package:shuffle/features/home/presentation/home_screen.dart';
|
|
|
|
part 'app_router.g.dart';
|
|
|
|
@Riverpod(keepAlive: true)
|
|
GoRouter appRouter(Ref ref) {
|
|
final source = ref.watch(redirectSourceProvider);
|
|
|
|
final router = GoRouter(
|
|
initialLocation: AppRoutes.home,
|
|
extraCodec: const VolatileExtraCodec(),
|
|
refreshListenable: source.changes,
|
|
redirect: (context, state) => source.redirect(state),
|
|
errorBuilder: (context, state) => const NotFoundScreen(),
|
|
routes: [
|
|
GoRoute(
|
|
path: AppRoutes.home,
|
|
builder: (context, state) => const HomeScreen(),
|
|
),
|
|
...authRoutes,
|
|
],
|
|
);
|
|
ref.onDispose(router.dispose);
|
|
return router;
|
|
}
|