mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-13 11:42:17 -04:00
work
This commit is contained in:
parent
f06657d700
commit
8907ce04ac
72 changed files with 539 additions and 224 deletions
|
@ -5,12 +5,14 @@ import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|||
import '../pages/pages.dart';
|
||||
import 'router_notifier.dart';
|
||||
|
||||
part 'router.g.dart';
|
||||
|
||||
final _key = GlobalKey<NavigatorState>(debugLabel: 'routerKey');
|
||||
|
||||
/// This simple provider caches our GoRouter.
|
||||
final routerProvider = Provider.autoDispose<GoRouter>((ref) {
|
||||
@riverpod
|
||||
GoRouter router(RouterRef ref) {
|
||||
final notifier = ref.watch(routerNotifierProvider.notifier);
|
||||
|
||||
return GoRouter(
|
||||
navigatorKey: _key,
|
||||
refreshListenable: notifier,
|
||||
|
@ -19,4 +21,4 @@ final routerProvider = Provider.autoDispose<GoRouter>((ref) {
|
|||
routes: notifier.routes,
|
||||
redirect: notifier.redirect,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue