forked from krille-chan/fluffychat
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bring back share link to join spaces (#1701)
- Loading branch information
Showing
5 changed files
with
141 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:go_router/go_router.dart'; | ||
|
||
import 'package:fluffychat/widgets/future_loading_dialog.dart'; | ||
import 'package:fluffychat/widgets/layouts/empty_page.dart'; | ||
import 'package:fluffychat/widgets/matrix.dart'; | ||
|
||
class JoinWithAlias extends StatefulWidget { | ||
const JoinWithAlias({super.key}); | ||
|
||
@override | ||
State<JoinWithAlias> createState() => _JoinWithAliasState(); | ||
} | ||
|
||
class _JoinWithAliasState extends State<JoinWithAlias> { | ||
@override | ||
void initState() { | ||
super.initState(); | ||
WidgetsBinding.instance.addPostFrameCallback( | ||
(_) => showFutureLoadingDialog( | ||
context: context, | ||
future: () async => _joinRoom(), | ||
), | ||
); | ||
} | ||
|
||
Future<void> _joinRoom() async { | ||
final String? alias = | ||
GoRouterState.of(context).uri.queryParameters['alias']; | ||
|
||
if (alias == null || alias.isEmpty) { | ||
context.go("/rooms"); | ||
return; | ||
} | ||
|
||
await MatrixState.pangeaController.classController.joinCachedRoomAlias( | ||
alias, | ||
context, | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) => const EmptyPage(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters