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':
|
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…
Add table
Add a link
Reference in a new issue