WT1.1.10+5 bugfix

This commit is contained in:
bossanyit
2021-03-28 12:45:14 +02:00
parent f724737ea3
commit 1962ba24cb
41 changed files with 397 additions and 173 deletions
+2 -2
View File
@@ -143,7 +143,7 @@ class _AppBarNav extends State<AppBarNav> with SingleTickerProviderStateMixin, C
Widget getAnimatedWidget() {
double cWidth = mediaSizeWidth(context);
double percent = Cache().getPercentExercises();
if (percent == -1) {
if (percent == -1 || percent.isNaN) {
menuBloc.menuTreeRepository.createTree();
ExerciseRepository exerciseRepository = ExerciseRepository();
exerciseRepository.getBaseExerciseFinishedPercent();
@@ -152,7 +152,7 @@ class _AppBarNav extends State<AppBarNav> with SingleTickerProviderStateMixin, C
percent = 0;
}
}
if (percent == null) {
if (percent == null || percent.isNaN) {
percent = 0;
}
int sizeExerciseList = Cache().getExercises() == null ? 0 : Cache().getExercises().length;
+8 -24
View File
@@ -1,5 +1,4 @@
import 'package:aitrainer_app/library/gradient_bottom_navigation_bar.dart';
import 'package:aitrainer_app/util/app_localization.dart';
import 'package:aitrainer_app/model/cache.dart';
import 'package:aitrainer_app/service/logging.dart';
import 'package:aitrainer_app/util/common.dart';
@@ -25,13 +24,6 @@ class _NawDrawerWidget extends State<BottomNavigator> with Trans, Logging {
super.initState();
}
@override
void didUpdateWidget(BottomNavigator oldWidget) {
Cache().initBadges();
super.didUpdateWidget(oldWidget);
}
@override
void didChangeDependencies() {
Cache().initBadges();
@@ -56,28 +48,25 @@ class _NawDrawerWidget extends State<BottomNavigator> with Trans, Logging {
backgroundColor: bgrColor,
icon: Common.badgedIcon(inactive, Icons.home, "home"),
activeIcon: Common.badgedIcon(active, Icons.home, "home"),
title: new Text(t("Home"), style: TextStyle(fontSize: 12)),
title: Text(t("Home"), style: TextStyle(fontSize: 12)),
),
BottomNavigationBarItem(
backgroundColor: bgrColor,
icon: new Icon(Icons.trending_up, color: inactive),
activeIcon: new Icon(
Icons.trending_up,
color: active,
),
title: new Text(
icon: Common.badgedIcon(inactive, Icons.trending_up, "development"),
activeIcon: Common.badgedIcon(active, Icons.trending_up, "development"),
title: Text(
t("My Development"),
style: TextStyle(fontSize: 12),
),
),
BottomNavigationBarItem(
backgroundColor: bgrColor,
icon: new Icon(Icons.featured_play_list, color: inactive),
activeIcon: new Icon(
icon: Icon(Icons.featured_play_list, color: inactive),
activeIcon: Icon(
Icons.featured_play_list,
color: active,
),
title: new Text(
title: Text(
t("My Training Plan"),
style: TextStyle(fontSize: 12),
),
@@ -87,7 +76,7 @@ class _NawDrawerWidget extends State<BottomNavigator> with Trans, Logging {
icon: Common.badgedIcon(inactive, Icons.person, "account"),
activeIcon: Common.badgedIcon(active, Icons.person, "account"),
title: Text(
AppLocalizations.of(context).translate("Account"),
t("Account"),
style: TextStyle(fontSize: 12),
)),
BottomNavigationBarItem(
@@ -95,11 +84,6 @@ class _NawDrawerWidget extends State<BottomNavigator> with Trans, Logging {
icon: Icon(Icons.settings, color: inactive),
activeIcon: Icon(Icons.settings, color: active),
title: Text(t("Settings"), style: TextStyle(fontSize: 12))),
/* BottomNavigationBarItem(
backgroundColor: bgrColor,
icon: Icon(Icons.multiple_stop, color: inactive),
activeIcon: Icon(Icons.multiple_stop, color: active),
title: Text(t("Multi test"), style: TextStyle(fontSize: 12))) */
],
onTap: (index) {
setState(() {
+2 -2
View File
@@ -231,7 +231,7 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
Divider(
color: Colors.transparent,
),
FlatButton(
/* FlatButton(
onPressed: () {
widget.onSubmit();
/* showDialog(
@@ -251,7 +251,7 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
style: TextStyle(fontSize: 16, color: Colors.white),
),
],
)),
)), */
]),
)));
}
+2 -2
View File
@@ -114,8 +114,8 @@ class ImageButton extends StatelessWidget {
: GestureDetector(
child: Image.asset(
'asset/image/lock.png',
height: 150,
width: 150,
height: 50,
width: 50,
),
onTap: onTap ?? onTap,
))
+12 -5
View File
@@ -53,7 +53,7 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
}
});
animation.addListener(() {
setState(() {});
//setState(() {});
});
}
@@ -65,6 +65,13 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
super.initState();
}
@override
bool didUpdateWidget(MenuPageWidget oldWidget) {
super.didUpdateWidget(oldWidget);
scrollController.animateTo(40, duration: Duration(milliseconds: 300), curve: Curves.easeIn);
return true;
}
@override
Widget build(BuildContext context) {
menuBloc = BlocProvider.of<MenuBloc>(context);
@@ -247,10 +254,10 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
SliverGrid sliverList = SliverGrid(
delegate: SliverChildListDelegate(list),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 1.0,
crossAxisSpacing: 1.0,
childAspectRatio: 3,
crossAxisCount: 4,
mainAxisSpacing: 1.5,
crossAxisSpacing: 1.5,
childAspectRatio: 2.5,
));
return sliverList;
}