@@ -10,6 +10,7 @@ import 'color.dart';
10
10
import 'dialog.dart' ;
11
11
import 'emoji.dart' ;
12
12
import 'inset_shadow.dart' ;
13
+ import 'reaction_users_sheet.dart' ;
13
14
import 'store.dart' ;
14
15
import 'text.dart' ;
15
16
import 'theme.dart' ;
@@ -120,6 +121,22 @@ class ReactionChipsList extends StatelessWidget {
120
121
final int messageId;
121
122
final Reactions reactions;
122
123
124
+ void showReactedUsers (BuildContext context, ReactionWithVotes selectedReaction) {
125
+ final store = PerAccountStoreWidget .of (context);
126
+
127
+ showModalBottomSheet <void >(
128
+ context: context,
129
+ builder: (BuildContext context) => PerAccountStoreWidget (
130
+ accountId: store.accountId,
131
+ child: ReactionUsersSheet (
132
+ reactions: reactions,
133
+ initialSelectedReaction: selectedReaction,
134
+ store: store,
135
+ ),
136
+ ),
137
+ );
138
+ }
139
+
123
140
@override
124
141
Widget build (BuildContext context) {
125
142
final store = PerAccountStoreWidget .of (context);
@@ -129,7 +146,9 @@ class ReactionChipsList extends StatelessWidget {
129
146
return Wrap (spacing: 4 , runSpacing: 4 , crossAxisAlignment: WrapCrossAlignment .center,
130
147
children: reactions.aggregated.map ((reactionVotes) => ReactionChip (
131
148
showName: showNames,
132
- messageId: messageId, reactionWithVotes: reactionVotes),
149
+ messageId: messageId, reactionWithVotes: reactionVotes,
150
+ showReactedUsers: showReactedUsers,
151
+ ),
133
152
).toList ());
134
153
}
135
154
}
@@ -138,12 +157,14 @@ class ReactionChip extends StatelessWidget {
138
157
final bool showName;
139
158
final int messageId;
140
159
final ReactionWithVotes reactionWithVotes;
160
+ final void Function (BuildContext , ReactionWithVotes ) showReactedUsers;
141
161
142
162
const ReactionChip ({
143
163
super .key,
144
164
required this .showName,
145
165
required this .messageId,
146
166
required this .reactionWithVotes,
167
+ required this .showReactedUsers,
147
168
});
148
169
149
170
@override
@@ -214,6 +235,9 @@ class ReactionChip extends StatelessWidget {
214
235
emojiName: emojiName,
215
236
);
216
237
},
238
+ onLongPress: () {
239
+ showReactedUsers (context, reactionWithVotes);
240
+ },
217
241
child: Padding (
218
242
// 1px of this padding accounts for the border, which Flutter
219
243
// just paints without changing size.
0 commit comments