Skip to content

Commit 2dc08a1

Browse files
authored
Merge pull request #459 from 12people/ux_fixes
Removing Dismissible for better discoverability
2 parents 607e8bf + 190f47f commit 2dc08a1

16 files changed

+426
-460
lines changed

lib/l10n/app_en.arb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,5 +808,11 @@
808808
"none__bodyweight_exercise_": "none (bodyweight exercise)",
809809
"@none__bodyweight_exercise_": {
810810
"description": "Generated entry for translation for server strings"
811-
}
811+
},
812+
"editSchedule": "Edit schedule",
813+
"log": "Log",
814+
"@log": {
815+
"description": "Log a specific meal"
816+
},
817+
"done": "Done"
812818
}

lib/screens/nutritional_plan_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class NutritionalPlanScreen extends StatelessWidget {
107107
),
108108
],
109109
flexibleSpace: FlexibleSpaceBar(
110+
titlePadding: const EdgeInsets.fromLTRB(56, 0, 56, 16),
110111
title: Text(
111112
nutritionalPlan.getLabel(context),
112113
style: Theme.of(context).textTheme.titleLarge?.copyWith(color: appBarForeground),

lib/screens/workout_plan_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class _WorkoutPlanScreenState extends State<WorkoutPlanScreen> {
8282
iconTheme: const IconThemeData(color: appBarForeground),
8383
backgroundColor: wgerPrimaryColor,
8484
flexibleSpace: FlexibleSpaceBar(
85+
titlePadding: const EdgeInsets.fromLTRB(56, 0, 56, 16),
8586
title: Text(
8687
workoutPlan.name,
8788
style: Theme.of(context).textTheme.titleLarge?.copyWith(color: appBarForeground),

lib/widgets/dashboard/widgets.dart

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,6 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
146146
return out;
147147
}
148148

149-
Widget getTrailing() {
150-
if (!_hasContent) {
151-
return const Text('');
152-
}
153-
154-
return _showDetail ? const Icon(Icons.expand_less) : const Icon(Icons.expand_more);
155-
}
156-
157149
@override
158150
Widget build(BuildContext context) {
159151
return Card(
@@ -174,24 +166,34 @@ class _DashboardNutritionWidgetState extends State<DashboardNutritionWidget> {
174166
Icons.restaurant,
175167
color: Theme.of(context).textTheme.headlineSmall!.color,
176168
),
177-
trailing: getTrailing(),
169+
trailing: _hasContent
170+
? Tooltip(
171+
message: AppLocalizations.of(context).toggleDetails,
172+
child: _showDetail
173+
? const Icon(
174+
Icons.info,
175+
)
176+
: const Icon(Icons.info_outline))
177+
: const SizedBox(),
178178
onTap: () {
179179
setState(() {
180180
_showDetail = !_showDetail;
181181
});
182182
},
183183
),
184184
if (_hasContent)
185-
Column(
186-
children: [
187-
...getContent(),
188-
Container(
189-
padding: const EdgeInsets.all(15),
190-
height: 180,
191-
child: FlNutritionalPlanPieChartWidget(_plan!.nutritionalValues),
192-
)
193-
],
194-
)
185+
Padding(
186+
padding: const EdgeInsets.symmetric(horizontal: 10),
187+
child: Column(
188+
children: [
189+
...getContent(),
190+
Container(
191+
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 15),
192+
height: 180,
193+
child: FlNutritionalPlanPieChartWidget(_plan!.nutritionalValues),
194+
)
195+
],
196+
))
195197
else
196198
NothingFound(
197199
AppLocalizations.of(context).noNutritionalPlans,
@@ -441,14 +443,6 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
441443
_hasContent = _workoutPlan != null;
442444
}
443445

444-
Widget getTrailing() {
445-
if (!_hasContent) {
446-
return const Text('');
447-
}
448-
449-
return _showDetail ? const Icon(Icons.expand_less) : const Icon(Icons.expand_more);
450-
}
451-
452446
List<Widget> getContent() {
453447
final List<Widget> out = [];
454448

@@ -540,16 +534,24 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
540534
Icons.fitness_center,
541535
color: Theme.of(context).textTheme.headlineSmall!.color,
542536
),
543-
trailing: getTrailing(),
537+
trailing: _hasContent
538+
? Tooltip(
539+
message: AppLocalizations.of(context).toggleDetails,
540+
child: _showDetail
541+
? const Icon(
542+
Icons.info,
543+
)
544+
: const Icon(Icons.info_outline))
545+
: const SizedBox(),
544546
onTap: () {
545547
setState(() {
546548
_showDetail = !_showDetail;
547549
});
548550
},
549551
),
550552
if (_hasContent)
551-
Container(
552-
padding: const EdgeInsets.only(left: 10),
553+
Padding(
554+
padding: const EdgeInsets.symmetric(horizontal: 10),
553555
child: Column(
554556
children: [
555557
...getContent(),

0 commit comments

Comments
 (0)