WT 1.1.24+5 training plan fixes
This commit is contained in:
+18
-12
@@ -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();
|
||||
}
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user