From 5b06a86576dcb39d666c654f360e5abdb09a2e0a Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sat, 20 Mar 2021 00:05:16 +0100 Subject: [PATCH] Add overflow behaviour for workout day descriptions --- lib/widgets/workouts/day.dart | 59 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/lib/widgets/workouts/day.dart b/lib/widgets/workouts/day.dart index c89ecf16..778f5fa2 100644 --- a/lib/widgets/workouts/day.dart +++ b/lib/widgets/workouts/day.dart @@ -192,38 +192,37 @@ class DayHeaderDismissible extends StatelessWidget { padding: const EdgeInsets.all(10), decoration: BoxDecoration(color: Colors.white), child: Row( - //mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - _day.description, - style: Theme.of(context).textTheme.headline5, - ), - Text(_day.getDaysText), - ], + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _day.description, + style: Theme.of(context).textTheme.headline5, + overflow: TextOverflow.ellipsis, + ), + Text(_day.getDaysText), + ], + ), ), - Expanded(child: Container()), - /* - if (_expanded) - IconButton( - icon: Icon(Icons.edit), - onPressed: () {}, - ), - */ - if (_expanded) - IconButton( - icon: Icon(Icons.delete), - onPressed: () { - Provider.of(context, listen: false).deleteDay(_day); - }, - ), - IconButton( - icon: _expanded ? Icon(Icons.expand_less) : Icon(Icons.expand_more), - onPressed: () { - _toggle(); - }, + Row( + children: [ + if (_expanded) + IconButton( + icon: Icon(Icons.delete), + onPressed: () { + Provider.of(context, listen: false).deleteDay(_day); + }, + ), + IconButton( + icon: _expanded ? Icon(Icons.expand_less) : Icon(Icons.expand_more), + onPressed: () { + _toggle(); + }, + ), + ], ), ], ),