When a user creates a new group from inside a class, the space ID will be stored via query
This commit is contained in:
parent
7e7c8810c8
commit
19809a6f2d
3 changed files with 30 additions and 15 deletions
|
|
@ -232,20 +232,26 @@ abstract class AppRoutes {
|
|||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const NewGroup(),
|
||||
NewGroup(
|
||||
// #Pangea
|
||||
spaceId: state.uri.queryParameters['spaceId'],
|
||||
// Pangea#
|
||||
),
|
||||
),
|
||||
redirect: loggedOutRedirect,
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: ':spaceid',
|
||||
pageBuilder: (context, state) => defaultPageBuilder(
|
||||
context,
|
||||
state,
|
||||
const NewGroup(),
|
||||
),
|
||||
redirect: loggedOutRedirect,
|
||||
),
|
||||
],
|
||||
// #Pangea
|
||||
// routes: [
|
||||
// GoRoute(
|
||||
// path: ':spaceid',
|
||||
// pageBuilder: (context, state) => defaultPageBuilder(
|
||||
// context,
|
||||
// state,
|
||||
// const NewGroup(),
|
||||
// ),
|
||||
// redirect: loggedOutRedirect,
|
||||
// ),
|
||||
// ],
|
||||
// Pangea#
|
||||
),
|
||||
GoRoute(
|
||||
path: 'newspace',
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ class StartChatFloatingActionButton extends StatelessWidget {
|
|||
void _onPressed(BuildContext context) async {
|
||||
//#Pangea
|
||||
if (controller.activeSpaceId != null) {
|
||||
context.go('/rooms/newgroup/${controller.activeSpaceId ?? ''}');
|
||||
// context.go('/rooms/newgroup/${controller.activeSpaceId ?? ''}');
|
||||
context.go('/rooms/newgroup?spaceId=${controller.activeSpaceId ?? ''}');
|
||||
return;
|
||||
}
|
||||
//Pangea#
|
||||
|
|
@ -44,7 +45,8 @@ class StartChatFloatingActionButton extends StatelessWidget {
|
|||
case ActiveFilter.groups:
|
||||
// #Pangea
|
||||
// context.go('/rooms/newgroup');
|
||||
context.go('/rooms/newgroup/${controller.activeSpaceId ?? ''}');
|
||||
// context.go('/rooms/newgroup/${controller.activeSpaceId ?? ''}');
|
||||
context.go('/rooms/newgroup?spaceId=${controller.activeSpaceId ?? ''}');
|
||||
// Pangea#
|
||||
break;
|
||||
case ActiveFilter.spaces:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,14 @@ import 'package:go_router/go_router.dart';
|
|||
import 'package:matrix/matrix.dart' as sdk;
|
||||
|
||||
class NewGroup extends StatefulWidget {
|
||||
const NewGroup({super.key});
|
||||
// #Pangea
|
||||
final String? spaceId;
|
||||
|
||||
const NewGroup({
|
||||
super.key,
|
||||
this.spaceId,
|
||||
});
|
||||
// Pangea#
|
||||
|
||||
@override
|
||||
NewGroupController createState() => NewGroupController();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue