fix reaction bubble
@@ -37,70 +37,68 @@ class ReactionBubble extends StatelessWidget {
|
|||||||
return Transform(
|
return Transform(
|
||||||
transform: Matrix4.rotationY(reverse ? pi : 0),
|
transform: Matrix4.rotationY(reverse ? pi : 0),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Center(
|
child: Stack(
|
||||||
child: Stack(
|
alignment: Alignment.center,
|
||||||
alignment: Alignment.center,
|
fit: StackFit.loose,
|
||||||
fit: StackFit.loose,
|
children: [
|
||||||
children: [
|
Transform.translate(
|
||||||
Transform.translate(
|
offset: Offset(reverse ? offset : -offset, 0),
|
||||||
offset: Offset(reverse ? offset : -offset, 0),
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: maskColor,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||||
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(2),
|
padding: EdgeInsets.symmetric(
|
||||||
decoration: BoxDecoration(
|
vertical: 4,
|
||||||
color: maskColor,
|
horizontal: totalReactions > 1 ? 4 : 0,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
|
||||||
),
|
),
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
padding: EdgeInsets.symmetric(
|
border: Border.all(
|
||||||
vertical: 4,
|
color: borderColor,
|
||||||
horizontal: totalReactions > 1 ? 4 : 0,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
border: Border.all(
|
|
||||||
color: borderColor,
|
|
||||||
),
|
|
||||||
color: backgroundColor,
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(14)),
|
|
||||||
),
|
|
||||||
child: LayoutBuilder(
|
|
||||||
builder: (context, constraints) {
|
|
||||||
return Flex(
|
|
||||||
direction: Axis.horizontal,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
if (constraints.maxWidth < double.infinity)
|
|
||||||
...reactions
|
|
||||||
.take((constraints.maxWidth) ~/ 24)
|
|
||||||
.map((reaction) {
|
|
||||||
return _buildReaction(
|
|
||||||
reactionIcons,
|
|
||||||
reaction,
|
|
||||||
context,
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
if (constraints.maxWidth == double.infinity)
|
|
||||||
...reactions.map((reaction) {
|
|
||||||
return _buildReaction(
|
|
||||||
reactionIcons,
|
|
||||||
reaction,
|
|
||||||
context,
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
|
color: backgroundColor,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(14)),
|
||||||
|
),
|
||||||
|
child: LayoutBuilder(
|
||||||
|
builder: (context, constraints) {
|
||||||
|
return Flex(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
if (constraints.maxWidth < double.infinity)
|
||||||
|
...reactions
|
||||||
|
.take((constraints.maxWidth) ~/ 24)
|
||||||
|
.map((reaction) {
|
||||||
|
return _buildReaction(
|
||||||
|
reactionIcons,
|
||||||
|
reaction,
|
||||||
|
context,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
if (constraints.maxWidth == double.infinity)
|
||||||
|
...reactions.map((reaction) {
|
||||||
|
return _buildReaction(
|
||||||
|
reactionIcons,
|
||||||
|
reaction,
|
||||||
|
context,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
),
|
||||||
bottom: 2,
|
Positioned(
|
||||||
left: reverse ? null : 13,
|
bottom: 2,
|
||||||
right: !reverse ? null : 13,
|
left: reverse ? null : 13,
|
||||||
child: _buildReactionsTail(context),
|
right: !reverse ? null : 13,
|
||||||
),
|
child: _buildReactionsTail(context),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ dependencies:
|
|||||||
rxdart: ^0.26.0
|
rxdart: ^0.26.0
|
||||||
scrollable_positioned_list: ^0.1.8
|
scrollable_positioned_list: ^0.1.8
|
||||||
jiffy: ^3.0.1
|
jiffy: ^3.0.1
|
||||||
flutter_svg: ">=0.21.0-nullsafety.0 <0.21.0"
|
flutter_svg: ^0.21.0
|
||||||
flutter_portal: ^0.3.0
|
flutter_portal: ^0.3.0
|
||||||
cached_network_image: ">=3.0.0-nullsafety <3.0.0"
|
cached_network_image: ">=3.0.0-nullsafety <3.0.0"
|
||||||
shimmer: ^1.1.2
|
shimmer: ^1.1.2
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 636 B |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |