fix: overflow in cute events

Signed-off-by: The one with the braid <the-one@with-the-braid.cf>
This commit is contained in:
The one with the braid 2023-06-21 15:55:23 +02:00
parent a3f3888a6f
commit 3956b7a754

View file

@ -36,19 +36,16 @@ class _CuteContentState extends State<CuteContent> {
return GestureDetector( return GestureDetector(
onTap: addOverlay, onTap: addOverlay,
child: SizedBox.square( child: Column(
dimension: 300, mainAxisSize: MainAxisSize.min,
child: Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min, children: [
mainAxisAlignment: MainAxisAlignment.center, Text(
children: [ widget.event.text,
Text( style: const TextStyle(fontSize: 150),
widget.event.text, ),
style: const TextStyle(fontSize: 150), if (label != null) Text(label)
), ],
if (label != null) Text(label)
],
),
), ),
); );
}, },
@ -144,24 +141,26 @@ class _CuteEventOverlayState extends State<CuteEventOverlay>
return SizedBox( return SizedBox(
height: constraints.maxHeight, height: constraints.maxHeight,
width: constraints.maxWidth, width: constraints.maxWidth,
child: Stack( child: OverflowBox(
alignment: Alignment.bottomLeft, child: Stack(
fit: StackFit.expand, alignment: Alignment.bottomLeft,
children: items fit: StackFit.expand,
.map( children: items
(position) => Positioned( .map(
left: position.width * width, (position) => Positioned(
bottom: (height * left: position.width * width,
.25 * bottom: (height *
position.height * .25 *
(controller?.value ?? 0)) - position.height *
_CuteOverlayContent.size, (controller?.value ?? 0)) -
child: _CuteOverlayContent( _CuteOverlayContent.size,
emoji: widget.emoji, child: _CuteOverlayContent(
emoji: widget.emoji,
),
), ),
), )
) .toList(),
.toList(), ),
), ),
); );
}, },