From 07671b7273feeaa4e66d44cef548122fc611f19c Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sun, 23 Apr 2023 13:10:17 +0200 Subject: [PATCH] Some polishing --- lib/widgets/dashboard/widgets.dart | 87 ++++++++++++++------------- lib/widgets/measurements/entries.dart | 1 - lib/widgets/workouts/day.dart | 2 +- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/lib/widgets/dashboard/widgets.dart b/lib/widgets/dashboard/widgets.dart index adab4328..63207305 100644 --- a/lib/widgets/dashboard/widgets.dart +++ b/lib/widgets/dashboard/widgets.dart @@ -162,7 +162,7 @@ class _DashboardNutritionWidgetState extends State { ListTile( title: Text( _hasContent ? _plan!.description : AppLocalizations.of(context).nutritionalPlan, - style: Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context).textTheme.headlineSmall, ), subtitle: Text( _hasContent @@ -172,7 +172,7 @@ class _DashboardNutritionWidgetState extends State { ), leading: Icon( Icons.restaurant, - color: Theme.of(context).textTheme.headlineMedium!.color, + color: Theme.of(context).textTheme.headlineSmall!.color, ), trailing: getTrailing(), onTap: () { @@ -254,11 +254,11 @@ class _DashboardWeightWidgetState extends State { ListTile( title: Text( AppLocalizations.of(context).weight, - style: Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context).textTheme.headlineSmall, ), leading: FaIcon( FontAwesomeIcons.weightScale, - color: Theme.of(context).textTheme.headlineMedium!.color, + color: Theme.of(context).textTheme.headlineSmall!.color, ), ), Column( @@ -324,9 +324,9 @@ class _DashboardMeasurementWidgetState extends State @override Widget build(BuildContext context) { - final _provider = Provider.of(context, listen: false); + final provider = Provider.of(context, listen: false); - List items = _provider.categories + final items = provider.categories .map( (item) => CategoriesCard( item, @@ -351,11 +351,11 @@ class _DashboardMeasurementWidgetState extends State ListTile( title: Text( AppLocalizations.of(context).measurements, - style: Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context).textTheme.headlineSmall, ), leading: FaIcon( - FontAwesomeIcons.weightScale, - color: Theme.of(context).textTheme.headlineMedium!.color, + FontAwesomeIcons.chartLine, + color: Theme.of(context).textTheme.headlineSmall!.color, ), trailing: IconButton( icon: const Icon(Icons.arrow_forward), @@ -368,11 +368,12 @@ class _DashboardMeasurementWidgetState extends State Column( children: [ if (items.isNotEmpty) - Column(children: [ - CarouselSlider( - items: items, - carouselController: _controller, - options: CarouselOptions( + Column( + children: [ + CarouselSlider( + items: items, + carouselController: _controller, + options: CarouselOptions( autoPlay: false, enlargeCenterPage: false, viewportFraction: 1, @@ -382,33 +383,35 @@ class _DashboardMeasurementWidgetState extends State setState(() { _current = index; }); - }), - ), - Padding( - padding: const EdgeInsets.only(bottom: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: items.asMap().entries.map((entry) { - return GestureDetector( - onTap: () => _controller.animateToPage(entry.key), - child: Container( - width: 12.0, - height: 12.0, - margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context) - .textTheme - .headlineMedium! - .color! - .withOpacity(_current == entry.key ? 0.9 : 0.4), - ), - ), - ); - }).toList(), + }, + ), ), - ), - ]) + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: items.asMap().entries.map((entry) { + return GestureDetector( + onTap: () => _controller.animateToPage(entry.key), + child: Container( + width: 12.0, + height: 12.0, + margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context) + .textTheme + .headlineSmall! + .color! + .withOpacity(_current == entry.key ? 0.9 : 0.4), + ), + ), + ); + }).toList(), + ), + ), + ], + ) else NothingFound( AppLocalizations.of(context).noMeasurementEntries, @@ -529,7 +532,7 @@ class _DashboardWorkoutWidgetState extends State { ListTile( title: Text( _hasContent ? _workoutPlan!.name : AppLocalizations.of(context).labelWorkoutPlan, - style: Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context).textTheme.headlineSmall, ), subtitle: Text( _hasContent @@ -539,7 +542,7 @@ class _DashboardWorkoutWidgetState extends State { ), leading: Icon( Icons.fitness_center_outlined, - color: Theme.of(context).textTheme.headlineMedium!.color, + color: Theme.of(context).textTheme.headlineSmall!.color, ), trailing: getTrailing(), onTap: () { diff --git a/lib/widgets/measurements/entries.dart b/lib/widgets/measurements/entries.dart index 416159ed..97381989 100644 --- a/lib/widgets/measurements/entries.dart +++ b/lib/widgets/measurements/entries.dart @@ -37,7 +37,6 @@ class EntriesList extends StatelessWidget { Widget build(BuildContext context) { return Column(children: [ Container( - color: Theme.of(context).cardColor, padding: const EdgeInsets.all(10), height: 220, child: MeasurementChartWidget( diff --git a/lib/widgets/workouts/day.dart b/lib/widgets/workouts/day.dart index c21b10f7..ca77cb33 100644 --- a/lib/widgets/workouts/day.dart +++ b/lib/widgets/workouts/day.dart @@ -220,7 +220,7 @@ class _WorkoutDayWidgetState extends State { ), ], ), - const Divider(), + if (_expanded) const Divider(), ReorderableListView( physics: const NeverScrollableScrollPhysics(), shrinkWrap: true,