mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-13 03:32:22 -04:00
checkpoint
This commit is contained in:
parent
c22d6fcff8
commit
8c22bf8cc0
24 changed files with 673 additions and 56 deletions
21
lib/router/router.dart
Normal file
21
lib/router/router.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import 'router_notifier.dart';
|
||||
|
||||
final _key = GlobalKey<NavigatorState>(debugLabel: 'routerKey');
|
||||
|
||||
/// This simple provider caches our GoRouter.
|
||||
final routerProvider = Provider.autoDispose<GoRouter>((ref) {
|
||||
final notifier = ref.watch(routerNotifierProvider.notifier);
|
||||
|
||||
return GoRouter(
|
||||
navigatorKey: _key,
|
||||
refreshListenable: notifier,
|
||||
debugLogDiagnostics: true,
|
||||
initialLocation: SplashPage.path,
|
||||
routes: notifier.routes,
|
||||
redirect: notifier.redirect,
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue