refactor: Make methods shorter
This commit is contained in:
parent
fcb9629525
commit
7355d6609d
2 changed files with 2 additions and 8 deletions
|
|
@ -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…
Add table
Reference in a new issue