@@ -31,6 +31,7 @@ import 'package:wger/providers/nutrition.dart';
31
31
import 'package:wger/providers/workout_plans.dart' ;
32
32
import 'package:wger/screens/form_screen.dart' ;
33
33
import 'package:wger/screens/gym_mode.dart' ;
34
+ import 'package:wger/screens/measurement_categories_screen.dart' ;
34
35
import 'package:wger/screens/nutritional_plan_screen.dart' ;
35
36
import 'package:wger/screens/weight_screen.dart' ;
36
37
import 'package:wger/screens/workout_plan_screen.dart' ;
@@ -260,19 +261,6 @@ class _DashboardWeightWidgetState extends State<DashboardWeightWidget> {
260
261
FontAwesomeIcons .weight,
261
262
color: Colors .black,
262
263
),
263
- trailing: IconButton (
264
- icon: const Icon (Icons .add),
265
- onPressed: () async {
266
- Navigator .pushNamed (
267
- context,
268
- FormScreen .routeName,
269
- arguments: FormScreenArguments (
270
- AppLocalizations .of (context).newEntry,
271
- WeightForm (),
272
- ),
273
- );
274
- },
275
- ),
276
264
),
277
265
Column (
278
266
children: [
@@ -287,13 +275,26 @@ class _DashboardWeightWidgetState extends State<DashboardWeightWidget> {
287
275
.toList ()),
288
276
),
289
277
Row (
290
- mainAxisAlignment: MainAxisAlignment .end ,
278
+ mainAxisAlignment: MainAxisAlignment .spaceBetween ,
291
279
children: < Widget > [
292
280
TextButton (
293
281
child: Text (AppLocalizations .of (context).goToDetailPage),
294
282
onPressed: () {
295
283
Navigator .of (context).pushNamed (WeightScreen .routeName);
296
284
}),
285
+ IconButton (
286
+ icon: const Icon (Icons .add),
287
+ onPressed: () async {
288
+ Navigator .pushNamed (
289
+ context,
290
+ FormScreen .routeName,
291
+ arguments: FormScreenArguments (
292
+ AppLocalizations .of (context).newEntry,
293
+ WeightForm (),
294
+ ),
295
+ );
296
+ },
297
+ ),
297
298
],
298
299
),
299
300
],
@@ -326,14 +327,23 @@ class _DashboardMeasurementWidgetState extends State<DashboardMeasurementWidget>
326
327
Widget build (BuildContext context) {
327
328
final _provider = Provider .of <MeasurementProvider >(context, listen: false );
328
329
329
- var items = _provider.categories
330
- .map (
330
+ List < Widget > items = _provider.categories
331
+ .map < Widget > (
331
332
(item) => CategoriesCard (
332
333
item,
333
334
elevation: 0 ,
334
335
),
335
336
)
336
337
.toList ();
338
+ if (items.isNotEmpty) {
339
+ items.add (
340
+ NothingFound (
341
+ AppLocalizations .of (context).moreMeasurementEntries,
342
+ AppLocalizations .of (context).newEntry,
343
+ MeasurementCategoryForm (),
344
+ ),
345
+ );
346
+ }
337
347
return Consumer <MeasurementProvider >(
338
348
builder: (context, workoutProvider, child) => Card (
339
349
child: Column (
@@ -348,6 +358,13 @@ class _DashboardMeasurementWidgetState extends State<DashboardMeasurementWidget>
348
358
FontAwesomeIcons .weight,
349
359
color: Colors .black,
350
360
),
361
+ trailing: IconButton (
362
+ icon: const Icon (Icons .arrow_forward),
363
+ onPressed: () => Navigator .pushNamed (
364
+ context,
365
+ MeasurementCategoriesScreen .routeName,
366
+ ),
367
+ ),
351
368
),
352
369
Column (
353
370
children: [
0 commit comments