Removed room provider
because I was unable to combine all routes under one provider.
This commit is contained in:
parent
5b9b48cd24
commit
b0c1f782bd
1 changed files with 28 additions and 35 deletions
|
@ -25,8 +25,6 @@ final GlobalKey<NavigatorState> _rootNavigatorKey =
|
||||||
GlobalKey<NavigatorState>(debugLabel: 'root');
|
GlobalKey<NavigatorState>(debugLabel: 'root');
|
||||||
final GlobalKey<NavigatorState> _userShellNavigatorKey =
|
final GlobalKey<NavigatorState> _userShellNavigatorKey =
|
||||||
GlobalKey<NavigatorState>(debugLabel: 'user');
|
GlobalKey<NavigatorState>(debugLabel: 'user');
|
||||||
final GlobalKey<NavigatorState> _roomShellNavigatorKey =
|
|
||||||
GlobalKey<NavigatorState>(debugLabel: 'room');
|
|
||||||
|
|
||||||
class OutbagApp extends StatefulWidget {
|
class OutbagApp extends StatefulWidget {
|
||||||
const OutbagApp({super.key});
|
const OutbagApp({super.key});
|
||||||
|
@ -225,43 +223,38 @@ class _OutbagAppState extends State {
|
||||||
GoRoute(
|
GoRoute(
|
||||||
name: 'room',
|
name: 'room',
|
||||||
path: 'r/:server/:id',
|
path: 'r/:server/:id',
|
||||||
|
redirect: (context, state) {
|
||||||
|
print(state.subloc);
|
||||||
|
return null;
|
||||||
|
},
|
||||||
builder: (context, state) => RoomPage(
|
builder: (context, state) => RoomPage(
|
||||||
state.params['server'] ?? '',
|
state.params['server'] ?? '',
|
||||||
state.params['id'] ?? ''),
|
state.params['id'] ?? ''),
|
||||||
routes: <RouteBase>[
|
routes: <RouteBase>[
|
||||||
ShellRoute(
|
GoRoute(
|
||||||
navigatorKey: _roomShellNavigatorKey,
|
name: 'edit-room',
|
||||||
builder: (context, state, child) =>
|
path: 'edit',
|
||||||
Provider.value(
|
builder: (context, state) =>
|
||||||
// TODO: provide nullable room data
|
EditRoomPage(
|
||||||
value: null,
|
state.params['server'] ??
|
||||||
child: child),
|
'',
|
||||||
routes: <RouteBase>[
|
state.params['id'] ?? '')),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
name: 'edit-room',
|
name: 'room-members',
|
||||||
path: 'edit',
|
path: 'members',
|
||||||
builder: (context, state) =>
|
builder: (context, state) =>
|
||||||
EditRoomPage(
|
ManageRoomMembersPage(
|
||||||
state.params['server'] ??
|
state.params['server'] ??
|
||||||
'',
|
'',
|
||||||
state.params['id'] ?? '')),
|
state.params['id'] ?? '')),
|
||||||
GoRoute(
|
GoRoute(
|
||||||
name: 'room-members',
|
name: 'room-permissions',
|
||||||
path: 'members',
|
path: 'roles',
|
||||||
builder: (context, state) =>
|
builder: (context, state) =>
|
||||||
ManageRoomMembersPage(
|
EditRoomPermissionSetPage(
|
||||||
state.params['server'] ??
|
state.params['server'] ??
|
||||||
'',
|
'',
|
||||||
state.params['id'] ?? '')),
|
state.params['id'] ?? '')),
|
||||||
GoRoute(
|
|
||||||
name: 'room-permissions',
|
|
||||||
path: 'roles',
|
|
||||||
builder: (context, state) =>
|
|
||||||
EditRoomPermissionSetPage(
|
|
||||||
state.params['server'] ??
|
|
||||||
'',
|
|
||||||
state.params['id'] ?? '')),
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
|
|
Loading…
Reference in a new issue