From 7e2148fa9be08b7764508dd6f61dbd6e309cfe00 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Sat, 13 Nov 2021 11:54:23 +0100 Subject: [PATCH] refactor: Make methods shorter --- lib/pages/user_bottom_sheet/user_bottom_sheet.dart | 5 +---- lib/widgets/profile_bottom_sheet.dart | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/pages/user_bottom_sheet/user_bottom_sheet.dart b/lib/pages/user_bottom_sheet/user_bottom_sheet.dart index c4976b03..f19be8de 100644 --- a/lib/pages/user_bottom_sheet/user_bottom_sheet.dart +++ b/lib/pages/user_bottom_sheet/user_bottom_sheet.dart @@ -86,10 +86,7 @@ class UserBottomSheetController extends State { 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) diff --git a/lib/widgets/profile_bottom_sheet.dart b/lib/widgets/profile_bottom_sheet.dart index 03a3186a..8b581a4b 100644 --- a/lib/widgets/profile_bottom_sheet.dart +++ b/lib/widgets/profile_bottom_sheet.dart @@ -25,10 +25,7 @@ class ProfileBottomSheet extends StatelessWidget { final client = Matrix.of(context).client; final result = await showFutureLoadingDialog( 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]);