diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index edefd740..03e42ddc 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -124,10 +124,7 @@ class _DashboardScreenState extends State { DashboardWorkoutWidget(), DashboardNutritionWidget(), DashboardWeightWidget(), - Container( - height: 650, // TODO: refactor calendar so we can get rid of size - child: DashboardCalendarWidget(), - ), + DashboardCalendarWidget(), ], ), ), diff --git a/lib/widgets/dashboard/calendar.dart b/lib/widgets/dashboard/calendar.dart index ac9eb94b..1e72a0b1 100644 --- a/lib/widgets/dashboard/calendar.dart +++ b/lib/widgets/dashboard/calendar.dart @@ -226,36 +226,30 @@ class _DashboardCalendarWidgetState extends State }, ), const SizedBox(height: 8.0), - Expanded( - child: ValueListenableBuilder>( - valueListenable: _selectedEvents, - builder: (context, value, _) { - return ListView.builder( - itemCount: value.length, - itemBuilder: (context, index) { - return Container( - width: double.infinity, - child: ListTile( - title: Text((() { - switch (value[index].type) { - case EventType.caloriesDiary: - return AppLocalizations.of(context)!.nutritionalDiary; + ValueListenableBuilder>( + valueListenable: _selectedEvents, + builder: (context, value, _) => Column( + children: [ + ...value + .map((event) => ListTile( + title: Text((() { + switch (event.type) { + case EventType.caloriesDiary: + return AppLocalizations.of(context)!.nutritionalDiary; - case EventType.session: - return AppLocalizations.of(context)!.workoutSession; + case EventType.session: + return AppLocalizations.of(context)!.workoutSession; - case EventType.weight: - return AppLocalizations.of(context)!.weight; - } - return value[index].description.toString(); - })()), - subtitle: Text(value[index].description.toString()), - onTap: () => print('${value[index]} tapped!'), - ), - ); - }, - ); - }, + case EventType.weight: + return AppLocalizations.of(context)!.weight; + } + return event.description.toString(); + })()), + subtitle: Text(event.description.toString()), + //onTap: () => print('$event tapped!'), + )) + .toList() + ], ), ), ],