From 922e7ad0ff8751763ec1c3a89054be7be78d872e Mon Sep 17 00:00:00 2001 From: The one with the braid Date: Wed, 21 Jun 2023 15:55:23 +0200 Subject: [PATCH] fix: overflow in cute events Signed-off-by: The one with the braid --- lib/pages/chat/events/cute_events.dart | 59 +++++++++++++------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/lib/pages/chat/events/cute_events.dart b/lib/pages/chat/events/cute_events.dart index def8350f..ff9d3906 100644 --- a/lib/pages/chat/events/cute_events.dart +++ b/lib/pages/chat/events/cute_events.dart @@ -36,19 +36,16 @@ class _CuteContentState extends State { return GestureDetector( onTap: addOverlay, - child: SizedBox.square( - dimension: 300, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - widget.event.text, - style: const TextStyle(fontSize: 150), - ), - if (label != null) Text(label) - ], - ), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + widget.event.text, + style: const TextStyle(fontSize: 150), + ), + if (label != null) Text(label) + ], ), ); }, @@ -144,24 +141,26 @@ class _CuteEventOverlayState extends State return SizedBox( height: constraints.maxHeight, width: constraints.maxWidth, - child: Stack( - alignment: Alignment.bottomLeft, - fit: StackFit.expand, - children: items - .map( - (position) => Positioned( - left: position.width * width, - bottom: (height * - .25 * - position.height * - (controller?.value ?? 0)) - - _CuteOverlayContent.size, - child: _CuteOverlayContent( - emoji: widget.emoji, + child: OverflowBox( + child: Stack( + alignment: Alignment.bottomLeft, + fit: StackFit.expand, + children: items + .map( + (position) => Positioned( + left: position.width * width, + bottom: (height * + .25 * + position.height * + (controller?.value ?? 0)) - + _CuteOverlayContent.size, + child: _CuteOverlayContent( + emoji: widget.emoji, + ), ), - ), - ) - .toList(), + ) + .toList(), + ), ), ); },