Almost everywhere click avatar can open popup profile

This commit is contained in:
LittleSheep 2024-06-27 15:57:02 +08:00
parent f239fbbed6
commit e84bca8948
4 changed files with 60 additions and 4 deletions

View File

@ -3,6 +3,7 @@ import 'package:get/get.dart';
import 'package:solian/models/friendship.dart';
import 'package:solian/providers/friend.dart';
import 'package:solian/widgets/account/account_avatar.dart';
import 'package:solian/widgets/account/account_profile_popup.dart';
class SliverFriendList extends StatelessWidget {
final int accountId;
@ -49,7 +50,20 @@ class SliverFriendList extends StatelessWidget {
child: ListTile(
title: Text(otherside.nick),
subtitle: Text(otherside.name),
leading: AccountAvatar(content: otherside.avatar),
leading: GestureDetector(
child: AccountAvatar(content: otherside.avatar),
onTap: () {
showModalBottomSheet(
useRootNavigator: true,
isScrollControlled: true,
backgroundColor: Theme.of(context).colorScheme.surface,
context: context,
builder: (context) => AccountProfilePopup(
account: otherside,
),
);
},
),
),
onDismissed: (direction) {
final FriendProvider provider = Get.find();

View File

@ -6,6 +6,7 @@ import 'package:solian/models/channel.dart';
import 'package:solian/providers/auth.dart';
import 'package:solian/services.dart';
import 'package:solian/widgets/account/account_avatar.dart';
import 'package:solian/widgets/account/account_profile_popup.dart';
import 'package:solian/widgets/account/friend_select.dart';
class ChannelMemberListPopup extends StatefulWidget {
@ -151,7 +152,20 @@ class _ChannelMemberListPopupState extends State<ChannelMemberListPopup> {
return ListTile(
title: Text(element.account.nick),
subtitle: Text(element.account.name),
leading: AccountAvatar(content: element.account.avatar),
leading: GestureDetector(
child: AccountAvatar(content: element.account.avatar),
onTap: () {
showModalBottomSheet(
useRootNavigator: true,
isScrollControlled: true,
backgroundColor: Theme.of(context).colorScheme.surface,
context: context,
builder: (context) => AccountProfilePopup(
account: element.account,
),
);
},
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [

View File

@ -7,6 +7,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
import 'package:solian/models/message.dart';
import 'package:solian/widgets/account/account_avatar.dart';
import 'package:solian/widgets/account/account_profile_popup.dart';
import 'package:solian/widgets/attachments/attachment_list.dart';
import 'package:timeago/timeago.dart' show format;
import 'package:url_launcher/url_launcher_string.dart';
@ -140,7 +141,20 @@ class ChatMessage extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AccountAvatar(content: item.sender.account.avatar),
GestureDetector(
child: AccountAvatar(content: item.sender.account.avatar),
onTap: () {
showModalBottomSheet(
useRootNavigator: true,
isScrollControlled: true,
backgroundColor: Theme.of(context).colorScheme.surface,
context: context,
builder: (context) => AccountProfilePopup(
account: item.sender.account,
),
);
},
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -6,6 +6,7 @@ import 'package:solian/models/realm.dart';
import 'package:solian/providers/auth.dart';
import 'package:solian/services.dart';
import 'package:solian/widgets/account/account_avatar.dart';
import 'package:solian/widgets/account/account_profile_popup.dart';
import 'package:solian/widgets/account/friend_select.dart';
class RealmMemberListPopup extends StatefulWidget {
@ -148,7 +149,20 @@ class _RealmMemberListPopupState extends State<RealmMemberListPopup> {
return ListTile(
title: Text(element.account.nick),
subtitle: Text(element.account.name),
leading: AccountAvatar(content: element.account.avatar),
leading: GestureDetector(
child: AccountAvatar(content: element.account.avatar),
onTap: () {
showModalBottomSheet(
useRootNavigator: true,
isScrollControlled: true,
backgroundColor: Theme.of(context).colorScheme.surface,
context: context,
builder: (context) => AccountProfilePopup(
account: element.account,
),
);
},
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [