mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-11 07:30:17 -04:00
break everything
This commit is contained in:
parent
e898074387
commit
29210c89d2
121 changed files with 2892 additions and 2608 deletions
20
lib/router/make_router.dart
Normal file
20
lib/router/make_router.dart
Normal file
|
@ -0,0 +1,20 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:stream_transform/stream_transform.dart';
|
||||
|
||||
import '../tools/stream_listenable.dart';
|
||||
import 'cubit/router_cubit.dart';
|
||||
|
||||
final _key = GlobalKey<NavigatorState>(debugLabel: 'routerKey');
|
||||
|
||||
/// This simple provider caches our GoRouter.
|
||||
GoRouter router({required RouterCubit routerCubit}) => GoRouter(
|
||||
navigatorKey: _key,
|
||||
refreshListenable: StreamListenable(
|
||||
routerCubit.stream.startWith(routerCubit.state).distinct()),
|
||||
debugLogDiagnostics: kDebugMode,
|
||||
initialLocation: '/',
|
||||
routes: routerCubit.routes,
|
||||
redirect: routerCubit.redirect,
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue