WT1.1.6+3 bodyType animation, bug fixes

This commit is contained in:
bossanyit
2021-02-20 16:48:01 +01:00
parent 3c5360f224
commit cf348cebb0
293 changed files with 2966 additions and 1673 deletions
-1
View File
@@ -5,7 +5,6 @@ import 'package:aitrainer_app/localization/app_localization.dart';
import 'package:aitrainer_app/model/cache.dart';
import 'package:aitrainer_app/repository/exercise_repository.dart';
import 'package:aitrainer_app/util/common.dart';
import 'package:aitrainer_app/util/trans.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+75
View File
@@ -0,0 +1,75 @@
import 'package:aitrainer_app/util/common.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:liquid_progress_indicator/liquid_progress_indicator.dart';
class AppBarProgress extends StatefulWidget implements PreferredSizeWidget {
final int max;
final int min;
const AppBarProgress({this.max, this.min});
@override
_AppBarNav createState() => _AppBarNav();
@override
Size get preferredSize => const Size.fromHeight(50);
}
class _AppBarNav extends State<AppBarProgress> with SingleTickerProviderStateMixin, Common {
AnimationController _animationController;
@override
void initState() {
_animationController = AnimationController(
lowerBound: (widget.min).toDouble(),
upperBound: (widget.max).toDouble(),
//upperBound: (widget.value / 100).toDouble(),
vsync: this,
duration: Duration(seconds: 3),
);
_animationController.addListener(() => setState(() {}));
_animationController.forward();
//Future.delayed(Duration(seconds: 3)).then((value) => _animationController.repeat());
super.initState();
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AppBar(
backgroundColor: Colors.black,
title: getAnimatedWidget(),
leading: IconButton(
icon: Icon(Icons.arrow_back, color: Colors.white),
onPressed: () => {Navigator.of(context).pop()},
));
}
Widget getAnimatedWidget() {
final percentage = _animationController.value;
return Container(
width: double.infinity,
height: 35,
padding: EdgeInsets.symmetric(horizontal: 24.0),
child: LiquidLinearProgressIndicator(
value: _animationController.value / 100,
backgroundColor: Colors.black,
valueColor: AlwaysStoppedAnimation(Color(0xffb4f500)),
borderRadius: 12.0,
center: Text(
"${percentage.toStringAsFixed(0)}%",
style: TextStyle(
color: Colors.yellow[50],
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
));
}
}
+2 -2
View File
@@ -84,7 +84,7 @@ class _BMIState extends State<BMI> with Trans {
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('asset/image/WT_black_background.png'),
image: AssetImage('asset/image/WT_black_background.jpg'),
fit: BoxFit.fill,
alignment: Alignment.center,
),
@@ -141,7 +141,7 @@ class _BMIState extends State<BMI> with Trans {
Container(
padding: EdgeInsets.only(left: 30, right: 30),
child: Image.asset(
"asset/image/BMI_graph_c.png",
"asset/image/BMI_graph_C.png",
),
),
Positioned(
+1 -1
View File
@@ -99,7 +99,7 @@ class _BMRState extends State<BMR> with Trans {
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('asset/image/WT_black_background.png'),
image: AssetImage('asset/image/WT_black_background.jpg'),
fit: BoxFit.fill,
alignment: Alignment.center,
),
+21 -6
View File
@@ -1,8 +1,10 @@
import 'package:aitrainer_app/localization/app_localization.dart';
import 'package:aitrainer_app/model/cache.dart';
import 'package:aitrainer_app/service/logging.dart';
import 'package:aitrainer_app/util/common.dart';
import 'package:aitrainer_app/util/enums.dart';
import 'package:aitrainer_app/util/track.dart';
import 'package:aitrainer_app/util/trans.dart';
import 'package:flurry/flurry.dart';
import 'package:flutter/material.dart';
import 'package:gradient_bottom_navigation_bar/gradient_bottom_navigation_bar.dart';
@@ -23,6 +25,19 @@ 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();
super.didChangeDependencies();
}
@override
Widget build(BuildContext context) {
final Color bgrColor = Color(0xffb4f500);
@@ -87,30 +102,30 @@ class _NawDrawerWidget extends State<BottomNavigator> with Trans, Logging {
switch (index) {
case 0:
Navigator.of(context).pop();
Flurry.logEvent("Home");
Track().track(TrackingEvent.home);
Navigator.of(context).pushNamed('home');
break;
case 1:
Navigator.of(context).pop();
Flurry.logEvent("myDevelopment");
Track().track(TrackingEvent.my_development);
Navigator.of(context).pushNamed('myDevelopment');
break;
case 2:
Navigator.of(context).pop();
Flurry.logEvent("myExercisePlan");
Track().track(TrackingEvent.my_exerciseplan);
Navigator.of(context).pushNamed('myExercisePlan');
break;
case 3:
Navigator.of(context).pop();
Flurry.logEvent("Account");
Track().track(TrackingEvent.account);
Navigator.of(context).pushNamed('account');
break;
case 4:
Navigator.of(context).pop();
Flurry.logEvent("Settings");
Track().track(TrackingEvent.settings);
Navigator.of(context).pushNamed('settings');
break;
+1 -1
View File
@@ -49,7 +49,7 @@ class _DialogPremiumState extends State<DialogCommon> with Trans {
borderRadius: BorderRadius.circular(24),
boxShadow: [BoxShadow(color: Colors.black, offset: Offset(0, 10), blurRadius: 10)],
image: DecorationImage(
image: AssetImage('asset/image/WT_black_G_background.png'),
image: AssetImage('asset/image/WT_black_G_background.jpg'),
fit: BoxFit.cover,
alignment: Alignment.center,
),
+1 -1
View File
@@ -360,7 +360,7 @@ class _DialogPremiumState extends State<DialogGDPR> with Trans {
borderRadius: BorderRadius.circular(24),
boxShadow: [BoxShadow(color: Colors.black, offset: Offset(0, 10), blurRadius: 10)],
image: DecorationImage(
image: AssetImage('asset/image/WT_light_background.png'),
image: AssetImage('asset/image/WT_light_background.jpg'),
fit: BoxFit.cover,
alignment: Alignment.center,
),
+1 -1
View File
@@ -72,7 +72,7 @@ class _DialogPremiumState extends State<DialogPremium> with Trans {
borderRadius: BorderRadius.circular(24),
boxShadow: [BoxShadow(color: Colors.black, offset: Offset(0, 10), blurRadius: 10)],
image: DecorationImage(
image: AssetImage('asset/image/WT_black_G_background.png'),
image: AssetImage('asset/image/WT_black_G_background.jpg'),
fit: BoxFit.cover,
alignment: Alignment.center,
),
+3 -2
View File
@@ -79,8 +79,9 @@ class _HomePageState extends State<AitrainerHome> with Logging {
return MenuPage(parent: 0);
}
} else {
log("else");
return MenuPage(parent: 0);
log("home: unknown state");
//return MenuPage(parent: 0);
return LoginPage();
}
}),
);
+24 -16
View File
@@ -58,7 +58,7 @@ class ImageButton extends StatelessWidget {
return Stack(alignment: AlignmentDirectional.bottomStart, children: [
FlatButton(
child: image == null
? _getButtonImage("asset/image/WT_menu_dark.png")
? _getButtonImage("asset/image/WT_menu_dark.jpg")
: isMarked
? Stack(
children: [
@@ -103,31 +103,39 @@ class ImageButton extends StatelessWidget {
],
)),
)),
Cache().hasPurchased
isMarked == null || Cache().hasPurchased
? Offstage()
: Stack(alignment: Alignment.topCenter, children: [
Positioned(
top: 10,
left: (width / 2 - 30) / 2 - 75,
child: !isLocked
? Offstage()
: GestureDetector(
child: Image.asset(
'asset/image/lock.png',
height: 150,
width: 150,
),
onTap: onTap ?? onTap,
))
]),
isLocked == null
? Offstage()
: Stack(alignment: Alignment.topCenter, children: [
Positioned(
top: 10,
left: (width / 2 - 30) / 2 - 75,
child: this.isLocked
child: isMarked
? GestureDetector(
child: Image.asset(
'asset/image/lock.png',
height: 150,
width: 150,
'asset/image/haken.png',
height: 70,
width: 70,
),
onTap: onTap ?? onTap,
)
: isMarked
? GestureDetector(
child: Image.asset(
'asset/image/haken.png',
height: 70,
width: 70,
),
onTap: onTap ?? onTap,
)
: Container(),
: Offstage(),
)
]),
]
+1 -1
View File
@@ -6,7 +6,7 @@ class LoadingScreenMain extends StatelessWidget {
@override
Widget build(BuildContext context) {
final Image _backgroundImage = Image.asset(
'asset/image/WT01_loading_layers.png',
'asset/image/WT_loading_layers.jpg',
fit: BoxFit.cover,
height: double.infinity,
width: double.infinity,
+17 -12
View File
@@ -142,19 +142,23 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
])))));
});
}
/* LiveSliverList sliverList = LiveSliverList(
// And attach root sliver scrollController to widgets
controller: scrollController,
itemCount: _columnChildren.length,
reAnimateOnVisibility: false,
showItemDuration: Duration(milliseconds: 100),
itemBuilder: (BuildContext context, int index, Animation<double> animation) => FadeTransition(
opacity: animation,
child: _columnChildren[index],
),
*/
//delegate: SliverChildListDelegate(_columnChildren),
SliverList sliverList = SliverList(
//itemCount: _columnChildren.length,
//reAnimateOnVisibility: false,
//showItemDuration: Duration(milliseconds: 150),
//itemBuilder: (BuildContext context, int index, Animation<double> animation) => FadeTransition(
// opacity: animation,
// child: _columnChildren[index],
//),
//controller: scrollController,
delegate: SliverChildListDelegate(_columnChildren),
);
slivers.add(sliverList);
return slivers;
}
@@ -377,11 +381,12 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
borderRadius: BorderRadius.circular(24.0),
child: Container(
color: Colors.transparent,
child: FadeInImage(
fadeInDuration: Duration(milliseconds: 200),
child: Image.asset(workoutTree.imageName),
/* FadeInImage(
fadeInDuration: Duration(milliseconds: 50),
image: AssetImage(workoutTree.imageName),
placeholder: MemoryImage(kTransparentImage),
),
), */
));
}
}
+26 -7
View File
@@ -2,6 +2,7 @@ import 'package:aitrainer_app/util/trans.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class NumberPickerWidget extends StatefulWidget {
final Function(double) onChange;
final int minValue;
@@ -9,18 +10,35 @@ class NumberPickerWidget extends StatefulWidget {
final int initalValue;
final String unit;
final Color color;
double fontSize;
const NumberPickerWidget({Key key, this.minValue, this.maxValue, this.initalValue, this.unit, this.color, this.onChange})
: super(key: key);
NumberPickerWidget({Key key, this.minValue, this.maxValue, this.initalValue, this.unit, this.fontSize, this.color, this.onChange})
: super(key: key) {
fontSize = fontSize ?? 20;
}
@override
_NumberPickerWidgetState createState() => _NumberPickerWidgetState();
}
class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
FixedExtentScrollController _scrollController;
@override
void initState() {
super.initState();
_scrollController = FixedExtentScrollController(initialItem: widget.initalValue);
}
@override
void didUpdateWidget(NumberPickerWidget oldWidget) {
super.didUpdateWidget(oldWidget);
_scrollController.animateToItem(widget.initalValue, duration: Duration(milliseconds: 100), curve: Curves.easeIn);
}
Widget durationPicker({bool inSeconds = false, bool inHundredths = false}) {
double value = 0;
return CupertinoPicker(
scrollController: FixedExtentScrollController(initialItem: widget.initalValue),
scrollController: _scrollController,
backgroundColor: Colors.transparent,
onSelectedItemChanged: (x) {
currentData = x.toDouble();
@@ -29,7 +47,8 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
setState(() {});
widget.onChange(value);
},
children: List.generate(widget.maxValue, (index) => Text('$index ' + widget.unit, style: TextStyle(color: widget.color))),
children: List.generate(
widget.maxValue, (index) => Text('$index ' + widget.unit, style: TextStyle(color: widget.color, fontSize: widget.fontSize))),
itemExtent: 40,
);
}
@@ -40,16 +59,16 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
setContext(context);
return Container(
//color: Colors.white24,
width: MediaQuery.of(context).size.width * .45,
width: MediaQuery.of(context).size.width * .40,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
padding: const EdgeInsets.symmetric(horizontal: 5.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
color: Colors.transparent,
width: MediaQuery.of(context).size.width * .3,
width: MediaQuery.of(context).size.width * .35,
child: Center(
child: Container(
color: Colors.transparent,
+1 -1
View File
@@ -41,7 +41,7 @@ class SalesButton extends StatelessWidget {
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('asset/image/WT_sales_background_3x5.png'),
image: AssetImage('asset/image/WT_sales_background_3x5.jpg'),
fit: BoxFit.cover,
alignment: Alignment.center,
),
+1 -1
View File
@@ -32,7 +32,7 @@ class _SizeState extends State<SizeWidget> with Trans {
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('asset/image/WT_black_background.png'),
image: AssetImage('asset/image/WT_black_background.jpg'),
fit: BoxFit.fill,
alignment: Alignment.center,
),