mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 14:59:29 +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':
|
case 'message':
|
||||||
final roomIdResult = await showFutureLoadingDialog(
|
final roomIdResult = await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () => widget.user.startDirectChat(),
|
||||||
final roomId = await widget.user.startDirectChat();
|
|
||||||
return roomId;
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
if (roomIdResult.error != null) return;
|
if (roomIdResult.error != null) return;
|
||||||
VRouter.of(widget.outerContext)
|
VRouter.of(widget.outerContext)
|
||||||
|
@ -25,10 +25,7 @@ class ProfileBottomSheet extends StatelessWidget {
|
|||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
final result = await showFutureLoadingDialog<String>(
|
final result = await showFutureLoadingDialog<String>(
|
||||||
context: context,
|
context: context,
|
||||||
future: () async {
|
future: () => client.startDirectChat(userId),
|
||||||
final roomId = await client.startDirectChat(userId);
|
|
||||||
return roomId;
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
if (result.error == null) {
|
if (result.error == null) {
|
||||||
VRouter.of(context).toSegments(['rooms', result.result]);
|
VRouter.of(context).toSegments(['rooms', result.result]);
|
||||||
|
Loading…
Reference in New Issue
Block a user