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