refactor: Make methods shorter

This commit is contained in:
Krille Fear 2021-11-13 11:54:23 +01:00
parent a817773de8
commit 7e2148fa9b
2 changed files with 2 additions and 8 deletions

View File

@ -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)

View File

@ -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]);