WT 1.1.24+5 training plan fixes

This commit is contained in:
bossanyit
2021-11-05 18:40:58 +01:00
parent e8fc6cd7ec
commit 4c5aff91db
23 changed files with 263 additions and 126 deletions
+18 -12
View File
@@ -19,7 +19,8 @@ class AppBarNav extends StatefulWidget implements PreferredSizeWidget {
final MenuBloc? menuBloc;
final bool? isMenu;
final int? depth;
AppBarNav({this.menuBloc, this.isMenu, this.depth});
final VoidCallback? onTap;
AppBarNav({this.menuBloc, this.isMenu, this.depth, this.onTap});
@override
_AppBarNav createState() => _AppBarNav();
@@ -92,19 +93,24 @@ class _AppBarNav extends State<AppBarNav> with SingleTickerProviderStateMixin, C
),
leading: IconButton(
icon: Icon(Icons.arrow_back, color: Colors.white),
onPressed: () => {
timerBloc.add(TimerEnd(duration: 0)),
if (widget.isMenu != null)
{
if (menuBloc.workoutItem != null)
{
menuBloc.add(MenuTreeUp(parent: menuBloc.workoutItem!.parent)),
}
onPressed: () {
timerBloc.add(TimerEnd(duration: 0));
print("tapping ${widget.onTap}");
if (widget.onTap != null) {
print("tap");
widget.onTap!();
}
if (widget.isMenu != null) {
if (menuBloc.workoutItem != null) {
menuBloc.add(MenuTreeUp(parent: menuBloc.workoutItem!.parent));
}
else if (widget.depth != null)
{
if (widget.depth == 0) {Navigator.of(context).popAndPushNamed('home')} else {Navigator.of(context).pop()}
} else if (widget.depth != null) {
if (widget.depth == 0) {
Navigator.of(context).popAndPushNamed('home');
} else {
Navigator.of(context).pop();
}
}
},
));
}