diff --git a/lib/main.dart b/lib/main.dart index 9433bdd..06740a8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,8 +25,6 @@ final GlobalKey _rootNavigatorKey = GlobalKey(debugLabel: 'root'); final GlobalKey _userShellNavigatorKey = GlobalKey(debugLabel: 'user'); -final GlobalKey _roomShellNavigatorKey = -GlobalKey(debugLabel: 'room'); class OutbagApp extends StatefulWidget { const OutbagApp({super.key}); @@ -225,43 +223,38 @@ class _OutbagAppState extends State { GoRoute( name: 'room', path: 'r/:server/:id', + redirect: (context, state) { + print(state.subloc); + return null; + }, builder: (context, state) => RoomPage( state.params['server'] ?? '', state.params['id'] ?? ''), routes: [ - ShellRoute( - navigatorKey: _roomShellNavigatorKey, - builder: (context, state, child) => - Provider.value( - // TODO: provide nullable room data - value: null, - child: child), - routes: [ - GoRoute( - name: 'edit-room', - path: 'edit', - builder: (context, state) => - EditRoomPage( - state.params['server'] ?? - '', - state.params['id'] ?? '')), - GoRoute( - name: 'room-members', - path: 'members', - builder: (context, state) => - ManageRoomMembersPage( - state.params['server'] ?? - '', - state.params['id'] ?? '')), - GoRoute( - name: 'room-permissions', - path: 'roles', - builder: (context, state) => - EditRoomPermissionSetPage( - state.params['server'] ?? - '', - state.params['id'] ?? '')), - ]) + GoRoute( + name: 'edit-room', + path: 'edit', + builder: (context, state) => + EditRoomPage( + state.params['server'] ?? + '', + state.params['id'] ?? '')), + GoRoute( + name: 'room-members', + path: 'members', + builder: (context, state) => + ManageRoomMembersPage( + state.params['server'] ?? + '', + state.params['id'] ?? '')), + GoRoute( + name: 'room-permissions', + path: 'roles', + builder: (context, state) => + EditRoomPermissionSetPage( + state.params['server'] ?? + '', + state.params['id'] ?? '')), ]) ]), ]),