fix message reaction modal
This commit is contained in:
@@ -119,30 +119,26 @@ class MessageReactionsModal extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 16.0,
|
||||
right: 16,
|
||||
bottom: 16,
|
||||
left: 18,
|
||||
right: 18,
|
||||
bottom: 26,
|
||||
),
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4,
|
||||
crossAxisSpacing: 16,
|
||||
childAspectRatio: 0.75,
|
||||
mainAxisSpacing: 22,
|
||||
),
|
||||
itemCount: message.latestReactions.length,
|
||||
itemBuilder: (context, i) {
|
||||
final reaction = message.latestReactions[i];
|
||||
|
||||
return _buildReaction(
|
||||
reaction,
|
||||
child: Wrap(
|
||||
spacing: 16,
|
||||
runSpacing: 22,
|
||||
alignment: WrapAlignment.start,
|
||||
children:
|
||||
[...message.latestReactions, ...message.latestReactions]
|
||||
.map((e) => _buildReaction(
|
||||
e,
|
||||
currentUser,
|
||||
context,
|
||||
);
|
||||
},
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -152,13 +148,18 @@ class MessageReactionsModal extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Column _buildReaction(
|
||||
Widget _buildReaction(
|
||||
Reaction reaction,
|
||||
User currentUser,
|
||||
BuildContext context,
|
||||
) {
|
||||
final isCurrentUser = reaction.user.id == currentUser.id;
|
||||
return Column(
|
||||
return ConstrainedBox(
|
||||
constraints: BoxConstraints.loose(Size(
|
||||
64,
|
||||
98,
|
||||
)),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@@ -197,6 +198,7 @@ class MessageReactionsModal extends StatelessWidget {
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user