mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
fix: UserBottomSheet
This commit is contained in:
parent
642db67709
commit
dbb0464a2a
@ -81,6 +81,7 @@ class ChatUI extends StatelessWidget {
|
|||||||
builder: (c) => UserBottomSheet(
|
builder: (c) => UserBottomSheet(
|
||||||
user: controller.room.getUserByMXIDSync(
|
user: controller.room.getUserByMXIDSync(
|
||||||
controller.room.directChatMatrixID),
|
controller.room.directChatMatrixID),
|
||||||
|
outerContext: context,
|
||||||
onMention: () => controller
|
onMention: () => controller
|
||||||
.sendController.text +=
|
.sendController.text +=
|
||||||
'${controller.room.directChatMatrixID} ',
|
'${controller.room.directChatMatrixID} ',
|
||||||
@ -379,6 +380,7 @@ class ChatUI extends StatelessWidget {
|
|||||||
builder: (c) =>
|
builder: (c) =>
|
||||||
UserBottomSheet(
|
UserBottomSheet(
|
||||||
user: event.sender,
|
user: event.sender,
|
||||||
|
outerContext: context,
|
||||||
onMention: () => controller
|
onMention: () => controller
|
||||||
.sendController
|
.sendController
|
||||||
.text +=
|
.text +=
|
||||||
|
@ -110,7 +110,8 @@ class UserBottomSheetUI extends StatelessWidget {
|
|||||||
title: Text(L10n.of(context).username),
|
title: Text(L10n.of(context).username),
|
||||||
subtitle: Text(user.id),
|
subtitle: Text(user.id),
|
||||||
trailing: Icon(Icons.share_outlined),
|
trailing: Icon(Icons.share_outlined),
|
||||||
onTap: () => FluffyShare.share(user.id, context),
|
onTap: () => FluffyShare.share(
|
||||||
|
user.id, controller.widget.outerContext),
|
||||||
),
|
),
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -12,10 +12,12 @@ import 'ui/user_bottom_sheet_ui.dart';
|
|||||||
class UserBottomSheet extends StatefulWidget {
|
class UserBottomSheet extends StatefulWidget {
|
||||||
final User user;
|
final User user;
|
||||||
final Function onMention;
|
final Function onMention;
|
||||||
|
final BuildContext outerContext;
|
||||||
|
|
||||||
const UserBottomSheet({
|
const UserBottomSheet({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.user,
|
@required this.user,
|
||||||
|
@required this.outerContext,
|
||||||
this.onMention,
|
this.onMention,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@ -81,8 +83,9 @@ class UserBottomSheetController extends State<UserBottomSheet> {
|
|||||||
break;
|
break;
|
||||||
case 'message':
|
case 'message':
|
||||||
final roomId = await widget.user.startDirectChat();
|
final roomId = await widget.user.startDirectChat();
|
||||||
await AdaptivePageLayout.of(context)
|
await AdaptivePageLayout.of(widget.outerContext)
|
||||||
.pushNamedAndRemoveUntilIsFirst('/rooms/$roomId');
|
.pushNamedAndRemoveUntilIsFirst('/rooms/$roomId');
|
||||||
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ class ParticipantListItem extends StatelessWidget {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (c) => UserBottomSheet(
|
builder: (c) => UserBottomSheet(
|
||||||
user: user,
|
user: user,
|
||||||
|
outerContext: context,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
title: Row(
|
title: Row(
|
||||||
|
Loading…
Reference in New Issue
Block a user