fix: UserBottomSheet

This commit is contained in:
Christian Pauly 2021-05-01 10:04:44 +02:00
parent 642db67709
commit dbb0464a2a
4 changed files with 9 additions and 2 deletions

View File

@ -81,6 +81,7 @@ class ChatUI extends StatelessWidget {
builder: (c) => UserBottomSheet(
user: controller.room.getUserByMXIDSync(
controller.room.directChatMatrixID),
outerContext: context,
onMention: () => controller
.sendController.text +=
'${controller.room.directChatMatrixID} ',
@ -379,6 +380,7 @@ class ChatUI extends StatelessWidget {
builder: (c) =>
UserBottomSheet(
user: event.sender,
outerContext: context,
onMention: () => controller
.sendController
.text +=

View File

@ -110,7 +110,8 @@ class UserBottomSheetUI extends StatelessWidget {
title: Text(L10n.of(context).username),
subtitle: Text(user.id),
trailing: Icon(Icons.share_outlined),
onTap: () => FluffyShare.share(user.id, context),
onTap: () => FluffyShare.share(
user.id, controller.widget.outerContext),
),
if (presence != null)
ListTile(

View File

@ -12,10 +12,12 @@ import 'ui/user_bottom_sheet_ui.dart';
class UserBottomSheet extends StatefulWidget {
final User user;
final Function onMention;
final BuildContext outerContext;
const UserBottomSheet({
Key key,
@required this.user,
@required this.outerContext,
this.onMention,
}) : super(key: key);
@ -81,8 +83,9 @@ class UserBottomSheetController extends State<UserBottomSheet> {
break;
case 'message':
final roomId = await widget.user.startDirectChat();
await AdaptivePageLayout.of(context)
await AdaptivePageLayout.of(widget.outerContext)
.pushNamedAndRemoveUntilIsFirst('/rooms/$roomId');
Navigator.of(context, rootNavigator: false).pop();
break;
}
}

View File

@ -29,6 +29,7 @@ class ParticipantListItem extends StatelessWidget {
context: context,
builder: (c) => UserBottomSheet(
user: user,
outerContext: context,
),
),
title: Row(