Removed room provider

because I was unable to combine all routes
under one provider.
This commit is contained in:
Jakob Meier 2023-03-28 16:14:38 +02:00
parent 5b9b48cd24
commit b0c1f782bd
No known key found for this signature in database
GPG key ID: 66BDC7E6A01A6152

View file

@ -25,8 +25,6 @@ final GlobalKey<NavigatorState> _rootNavigatorKey =
GlobalKey<NavigatorState>(debugLabel: 'root');
final GlobalKey<NavigatorState> _userShellNavigatorKey =
GlobalKey<NavigatorState>(debugLabel: 'user');
final GlobalKey<NavigatorState> _roomShellNavigatorKey =
GlobalKey<NavigatorState>(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: <RouteBase>[
ShellRoute(
navigatorKey: _roomShellNavigatorKey,
builder: (context, state, child) =>
Provider.value(
// TODO: provide nullable room data
value: null,
child: child),
routes: <RouteBase>[
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'] ?? '')),
])
]),
]),