mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 06:22:34 +01:00
refactor: Make methods shorter
This commit is contained in:
parent
a817773de8
commit
7e2148fa9b
@ -86,10 +86,7 @@ class UserBottomSheetController extends State<UserBottomSheet> {
|
||||
case 'message':
|
||||
final roomIdResult = await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async {
|
||||
final roomId = await widget.user.startDirectChat();
|
||||
return roomId;
|
||||
},
|
||||
future: () => widget.user.startDirectChat(),
|
||||
);
|
||||
if (roomIdResult.error != null) return;
|
||||
VRouter.of(widget.outerContext)
|
||||
|
@ -25,10 +25,7 @@ class ProfileBottomSheet extends StatelessWidget {
|
||||
final client = Matrix.of(context).client;
|
||||
final result = await showFutureLoadingDialog<String>(
|
||||
context: context,
|
||||
future: () async {
|
||||
final roomId = await client.startDirectChat(userId);
|
||||
return roomId;
|
||||
},
|
||||
future: () => client.startDirectChat(userId),
|
||||
);
|
||||
if (result.error == null) {
|
||||
VRouter.of(context).toSegments(['rooms', result.result]);
|
||||
|
Loading…
Reference in New Issue
Block a user