From bdb97cfae84cba24ddd33da8fb42ca44585fc0c2 Mon Sep 17 00:00:00 2001 From: ARYPROGRAMMER Date: Wed, 23 Oct 2024 23:36:50 +0530 Subject: [PATCH] fix: RenderOverFlex in Dashboard UI --- devtools_options.yaml | 3 + lib/widgets/measurements/categories_card.dart | 107 +++++++++--------- 2 files changed, 58 insertions(+), 52 deletions(-) create mode 100644 devtools_options.yaml diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 00000000..fa0b357c --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/lib/widgets/measurements/categories_card.dart b/lib/widgets/measurements/categories_card.dart index f57c11a1..7e835a5b 100644 --- a/lib/widgets/measurements/categories_card.dart +++ b/lib/widgets/measurements/categories_card.dart @@ -22,60 +22,63 @@ class CategoriesCard extends StatelessWidget { return Card( elevation: elevation, - child: Column( - children: [ - Padding( - padding: const EdgeInsets.only(top: 5), - child: Text( - currentCategory.name, - style: Theme.of(context).textTheme.titleLarge, - ), - ), - Container( - padding: const EdgeInsets.all(10), - height: 220, - child: MeasurementChartWidgetFl( - entriesAll, - currentCategory.unit, - avgs: entries7dAvg, - ), - ), - if (entries7dAvg.isNotEmpty) - MeasurementOverallChangeWidget( - entries7dAvg.first, - entries7dAvg.last, - currentCategory.unit, - ), - const Divider(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - TextButton( - child: Text(AppLocalizations.of(context).goToDetailPage), - onPressed: () { - Navigator.pushNamed( - context, - MeasurementEntriesScreen.routeName, - arguments: currentCategory.id, - ); - }, + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: Column( + children: [ + Padding( + padding: const EdgeInsets.only(top: 5), + child: Text( + currentCategory.name, + style: Theme.of(context).textTheme.titleLarge, ), - IconButton( - onPressed: () async { - await Navigator.pushNamed( - context, - FormScreen.routeName, - arguments: FormScreenArguments( - AppLocalizations.of(context).newEntry, - MeasurementEntryForm(currentCategory.id!), - ), - ); - }, - icon: const Icon(Icons.add), + ), + Container( + padding: const EdgeInsets.all(10), + height: 220, + child: MeasurementChartWidgetFl( + entriesAll, + currentCategory.unit, + avgs: entries7dAvg, ), - ], - ), - ], + ), + if (entries7dAvg.isNotEmpty) + MeasurementOverallChangeWidget( + entries7dAvg.first, + entries7dAvg.last, + currentCategory.unit, + ), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TextButton( + child: Text(AppLocalizations.of(context).goToDetailPage), + onPressed: () { + Navigator.pushNamed( + context, + MeasurementEntriesScreen.routeName, + arguments: currentCategory.id, + ); + }, + ), + IconButton( + onPressed: () async { + await Navigator.pushNamed( + context, + FormScreen.routeName, + arguments: FormScreenArguments( + AppLocalizations.of(context).newEntry, + MeasurementEntryForm(currentCategory.id!), + ), + ); + }, + icon: const Icon(Icons.add), + ), + ], + ), + ], + ), ), ); }