WT 1.1.11+4 bug fixes

This commit is contained in:
bossanyit 2021-04-12 18:51:50 +02:00
parent 10c8a0a2d8
commit db103a1015
12 changed files with 79 additions and 25 deletions

View File

@ -84,6 +84,8 @@
"Yes": "Yes", "Yes": "Yes",
"No": "No", "No": "No",
"with": "with", "with": "with",
"Please repeat as much times as you can! MAXIMIZE it!":"Please repeat as much times as you can! MAXIMIZE it!",
"Please take a relative bigger weight and repeat 12-20 times and do your best! MAXIMIZE it!":"Please take a relative bigger weight and repeat 12-20 times and do your best! MAXIMIZE it!",
"Do you save this exercise with these parameters?":"Do you save this exercise with these parameters?", "Do you save this exercise with these parameters?":"Do you save this exercise with these parameters?",
"Did you try the MAXIMUM what you can do? Are you sure we save the exercise with ONLY 12 repeats?":"Did you try the MAXIMUM what you can do? Are you sure we save the exercise with ONLY 12 repeats?", "Did you try the MAXIMUM what you can do? Are you sure we save the exercise with ONLY 12 repeats?":"Did you try the MAXIMUM what you can do? Are you sure we save the exercise with ONLY 12 repeats?",
"The number of the exercise": "The number of the exercise", "The number of the exercise": "The number of the exercise",

View File

@ -275,6 +275,7 @@
"select your places by tapping":"kattints az edzéshelyszínre", "select your places by tapping":"kattints az edzéshelyszínre",
"Available Training Places":"Elérhető edzéshelyszínek", "Available Training Places":"Elérhető edzéshelyszínek",
"Please take a relative bigger weight and repeat 12-20 times and do your best! MAXIMIZE it!":"Válassz egy relatív nagyobb súlyt, amivel 12-20 közötti ismétlésre vagy képes, és adj bele mindent! MAXOLD KI!", "Please take a relative bigger weight and repeat 12-20 times and do your best! MAXIMIZE it!":"Válassz egy relatív nagyobb súlyt, amivel 12-20 közötti ismétlésre vagy képes, és adj bele mindent! MAXOLD KI!",
"Please repeat as much times as you can! MAXIMIZE it!":"Hajtsd végre a gyakorlatot, amennyiszer csak tudod! Ne állj meg, ha fáradt vagy, MAXOLD ki!",
"Please take a medium weight and repeat 20-30 times": "Válassz egy közepes súlyt, amivel maximum 20-30 közötti ismétlésre vagy képes", "Please take a medium weight and repeat 20-30 times": "Válassz egy közepes súlyt, amivel maximum 20-30 közötti ismétlésre vagy képes",
"Equipment Filter":"Eszköz szűrő", "Equipment Filter":"Eszköz szűrő",
"Live-Server":"Live-Server", "Live-Server":"Live-Server",

View File

@ -388,7 +388,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -531,7 +531,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -566,7 +566,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (

View File

@ -9,6 +9,14 @@ part 'exercise_control_event.dart';
part 'exercise_control_state.dart'; part 'exercise_control_state.dart';
enum ExerciseTypeLocal { oneRepMax, endurance }
extension ExerciseTypeLocalExt on ExerciseTypeLocal {
String toStr() => this.toString().split(".").last;
bool equalsTo(ExerciseTypeLocal type) => this.toString() == type.toString();
bool equalsStringTo(String type) => this.toStr() == type;
}
class ExerciseControlBloc extends Bloc<ExerciseControlEvent, ExerciseControlState> { class ExerciseControlBloc extends Bloc<ExerciseControlEvent, ExerciseControlState> {
final TimerBloc timerBloc; final TimerBloc timerBloc;
final ExerciseRepository exerciseRepository; final ExerciseRepository exerciseRepository;
@ -26,16 +34,25 @@ class ExerciseControlBloc extends Bloc<ExerciseControlEvent, ExerciseControlStat
double? firstUnitQuantity; // unit quantity of the first test double? firstUnitQuantity; // unit quantity of the first test
double scrollOffset = 0; double scrollOffset = 0;
late ExerciseTypeLocal exerciseTypeLocal;
@override @override
ExerciseControlBloc({required this.exerciseRepository, required this.readonly, required this.timerBloc}) ExerciseControlBloc({required this.exerciseRepository, required this.readonly, required this.timerBloc})
: super(ExerciseControlInitial()) { : super(ExerciseControlInitial()) {
print("Exercise ${exerciseRepository.exercise!.toJson()}"); print("Exercise ${exerciseRepository.exercise!.toJson()}");
exerciseTypeLocal = ExerciseTypeLocal.oneRepMax;
oneRepQuantity = exerciseRepository.exercise!.quantity!; oneRepQuantity = exerciseRepository.exercise!.quantity!;
if (oneRepQuantity > 25) {
exerciseTypeLocal = ExerciseTypeLocal.endurance;
}
oneRepUnitQuantity = exerciseRepository.exercise!.unitQuantity!; oneRepUnitQuantity = exerciseRepository.exercise!.unitQuantity!;
initialRM = this.calculate1RM(percent75: false); initialRM = this.calculate1RM(percent75: false);
unitQuantity = this.calculate1RM(percent75: true).roundToDouble(); unitQuantity = this.calculate1RM(percent75: true).roundToDouble();
quantity = 12; quantity = 12;
if (oneRepQuantity > 25) {
quantity = 35;
}
origQuantity = quantity; origQuantity = quantity;
exerciseRepository.setUnitQuantity(unitQuantity); exerciseRepository.setUnitQuantity(unitQuantity);
@ -47,11 +64,12 @@ class ExerciseControlBloc extends Bloc<ExerciseControlEvent, ExerciseControlStat
@override @override
Stream<ExerciseControlState> mapEventToState(ExerciseControlEvent event) async* { Stream<ExerciseControlState> mapEventToState(ExerciseControlEvent event) async* {
try { try {
if (event is ExerciseControlLoad) { /* if (event is ExerciseControlLoad) {
yield ExerciseControlLoading(); yield ExerciseControlLoading();
step = 1; step = 1;
yield ExerciseControlReady(); yield ExerciseControlReady();
} else if (event is ExerciseControlQuantityChange) { } else */
if (event is ExerciseControlQuantityChange) {
//yield ExerciseControlLoading(); //yield ExerciseControlLoading();
if (event.step == step) { if (event.step == step) {
exerciseRepository.setQuantity(event.quantity); exerciseRepository.setQuantity(event.quantity);
@ -60,7 +78,7 @@ class ExerciseControlBloc extends Bloc<ExerciseControlEvent, ExerciseControlStat
//yield ExerciseControlReady(); //yield ExerciseControlReady();
} else if (event is ExerciseControlUnitQuantityChange) { } else if (event is ExerciseControlUnitQuantityChange) {
yield ExerciseControlLoading(); yield ExerciseControlLoading();
print("event step ${event.step} quantity ${event.quantity}");
if (event.step == step) { if (event.step == step) {
this.unitQuantity = event.quantity; this.unitQuantity = event.quantity;
exerciseRepository.setUnitQuantity(event.quantity); exerciseRepository.setUnitQuantity(event.quantity);
@ -108,7 +126,12 @@ class ExerciseControlBloc extends Bloc<ExerciseControlEvent, ExerciseControlStat
print("Weight: $weight repeat: $repeat, $rmWendler, Oconner: $rmOconner"); print("Weight: $weight repeat: $repeat, $rmWendler, Oconner: $rmOconner");
double average = (rmWendler + rmOconner) / 2; double average = (rmWendler + rmOconner) / 2;
return percent75 ? average * 0.75 : average; double serieQuantity = 0.75;
if (exerciseTypeLocal.equalsTo(ExerciseTypeLocal.endurance)) {
serieQuantity = 0.5;
}
return percent75 ? average * serieQuantity : average;
} }
int calculateQuantityByUnitQuantity() { int calculateQuantityByUnitQuantity() {

View File

@ -21,7 +21,7 @@ class Track with Logging {
Flurry.logEvent(event.toString()); Flurry.logEvent(event.toString());
Smartlook.setGlobalEventProperty(event.toString(), eventValue, false); Smartlook.setGlobalEventProperty(event.toString(), eventValue, false);
model.Tracking tracking = model.Tracking(); model.Tracking tracking = model.Tracking();
tracking.customerId = Cache().userLoggedIn!.customerId!; tracking.customerId = Cache().userLoggedIn == null ? 0 : Cache().userLoggedIn!.customerId!;
tracking.event = event.enumToString(); tracking.event = event.enumToString();
if (eventValue.isNotEmpty) { if (eventValue.isNotEmpty) {
tracking.eventValue = eventValue; tracking.eventValue = eventValue;

View File

@ -598,7 +598,9 @@ class _AnimatedLiquidCustomProgressIndicatorState extends State<_AnimatedLiquidC
vsync: this, vsync: this,
duration: Duration(seconds: 3), duration: Duration(seconds: 3),
)..addListener(() { )..addListener(() {
setState(() {}); setState(() {
print("build animation state change");
});
}); });
_animationController.forward(); _animationController.forward();

View File

@ -41,8 +41,8 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
TimerBloc timerBloc = BlocProvider.of<TimerBloc>(context); TimerBloc timerBloc = BlocProvider.of<TimerBloc>(context);
return BlocProvider( return BlocProvider(
create: (context) => ExerciseControlBloc(exerciseRepository: exerciseRepository, readonly: readonly, timerBloc: timerBloc) create: (context) => ExerciseControlBloc(exerciseRepository: exerciseRepository, readonly: readonly, timerBloc: timerBloc),
..add(ExerciseControlLoad()), //..add(ExerciseControlLoad()),
child: BlocConsumer<ExerciseControlBloc, ExerciseControlState>(listener: (context, state) { child: BlocConsumer<ExerciseControlBloc, ExerciseControlState>(listener: (context, state) {
if (state is ExerciseControlError) { if (state is ExerciseControlError) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
@ -260,6 +260,7 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
Widget numberPickForm(ExerciseControlBloc exerciseBloc, int step) { Widget numberPickForm(ExerciseControlBloc exerciseBloc, int step) {
final String strTimes = step == 2 ? exerciseBloc.origQuantity.toStringAsFixed(0) : "max."; final String strTimes = step == 2 ? exerciseBloc.origQuantity.toStringAsFixed(0) : "max.";
//print("step $step, quantity ${exerciseBloc.origQuantity}");
String title = (step + 1).toString() + "/4 " + t("Control Exercise:"); String title = (step + 1).toString() + "/4 " + t("Control Exercise:");
LinkedHashMap args = LinkedHashMap(); LinkedHashMap args = LinkedHashMap();
@ -301,8 +302,8 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
TextSpan(text: t("hu_with") + " "), TextSpan(text: t("hu_with") + " "),
TextSpan( TextSpan(
text: strTimes + " ", text: strTimes + " ",
style: GoogleFonts.inter( style: GoogleFonts.archivoBlack(
fontSize: 16, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.yellow[100], color: Colors.yellow[100],
)), )),
@ -318,7 +319,7 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
NumberPickerWidget( NumberPickerWidget(
minValue: 0, minValue: 0,
maxValue: 200, maxValue: 200,
initalValue: exerciseBloc.quantity.round(), initalValue: exerciseBloc.origQuantity.round(),
unit: t("reps"), unit: t("reps"),
color: Colors.yellow[50]!, color: Colors.yellow[50]!,
onChange: (value) => {exerciseBloc.add(ExerciseControlQuantityChange(quantity: value.toDouble(), step: step))}), onChange: (value) => {exerciseBloc.add(ExerciseControlQuantityChange(quantity: value.toDouble(), step: step))}),
@ -372,10 +373,9 @@ class UnitQuantityControl extends StatefulWidget {
} }
class _UnitQuantityControlState extends State<UnitQuantityControl> with Trans { class _UnitQuantityControlState extends State<UnitQuantityControl> with Trans {
late double changedValue; double? changedValue;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
changedValue = widget.exerciseBloc.unitQuantity;
setContext(context); setContext(context);
return Dialog( return Dialog(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -431,12 +431,21 @@ class _UnitQuantityControlState extends State<UnitQuantityControl> with Trans {
initalValue: widget.exerciseBloc.unitQuantity.round(), initalValue: widget.exerciseBloc.unitQuantity.round(),
unit: t("kg"), unit: t("kg"),
color: Colors.yellow[50]!, color: Colors.yellow[50]!,
onChange: (value) => {changedValue = value}), onChange: (value) => {
setState(() {
changedValue = value;
})
}),
Align( Align(
alignment: Alignment.center, alignment: Alignment.center,
child: GestureDetector( child: GestureDetector(
onTap: () => { onTap: () => {
widget.exerciseBloc.add(ExerciseControlUnitQuantityChange(quantity: changedValue.toDouble(), step: widget.step)), if (changedValue == null)
{
changedValue = widget.exerciseBloc.unitQuantity,
},
//print("Changed new value $changedValue"),
widget.exerciseBloc.add(ExerciseControlUnitQuantityChange(quantity: changedValue!.toDouble(), step: widget.step)),
Navigator.of(context).pop(), Navigator.of(context).pop(),
}, },
child: Stack( child: Stack(

View File

@ -240,7 +240,9 @@ class _ExercisePlanDetailAddPage extends State<ExercisePlanDetailAddPage> with T
initialValue: bloc.quantityUnit.toStringAsFixed(0), initialValue: bloc.quantityUnit.toStringAsFixed(0),
keyboardType: TextInputType.numberWithOptions(decimal: true), keyboardType: TextInputType.numberWithOptions(decimal: true),
style: GoogleFonts.archivoBlack(fontSize: 60, color: Colors.yellow[200]), style: GoogleFonts.archivoBlack(fontSize: 60, color: Colors.yellow[200]),
onChanged: (value) => {bloc.add(ExercisePlanCustomAddChangeQuantityUnit(quantity: double.parse(value)))}) onChanged: (value) => {
if (value.isNotEmpty) {bloc.add(ExercisePlanCustomAddChangeQuantityUnit(quantity: double.parse(value)))}
})
: Offstage(), : Offstage(),
Divider(), Divider(),

View File

@ -350,7 +350,9 @@ class _ExerciseTileState extends State<ExerciseTile> with Trans {
animation.start(); animation.start();
animation.addStatusListener((status) { animation.addStatusListener((status) {
if (status == AnimationStatus.completed) { if (status == AnimationStatus.completed) {
setState(() {}); setState(() {
print("animation state completed");
});
} }
}); });

View File

@ -151,7 +151,7 @@ class Search extends StatelessWidget with Trans {
searchBoxDecoration: InputDecoration( searchBoxDecoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 15, top: 5, bottom: 5), contentPadding: EdgeInsets.only(left: 15, top: 5, bottom: 5),
labelText: t("Search Exercises..."), labelText: t("Search Exercises..."),
labelStyle: GoogleFonts.inter(fontSize: 14, color: Colors.grey[400]), labelStyle: GoogleFonts.inter(fontSize: 12, color: Colors.grey[400]),
fillColor: Colors.white24, fillColor: Colors.white24,
filled: true, filled: true,
border: OutlineInputBorder( border: OutlineInputBorder(

View File

@ -30,6 +30,7 @@ class NumberPickerWidget extends StatefulWidget {
class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans { class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
late FixedExtentScrollController _scrollController; late FixedExtentScrollController _scrollController;
double value = 0;
@override @override
void initState() { void initState() {
@ -38,13 +39,22 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
_scrollController.animateToItem(widget.initalValue, duration: Duration(milliseconds: 100), curve: Curves.easeIn); _scrollController.animateToItem(widget.initalValue, duration: Duration(milliseconds: 100), curve: Curves.easeIn);
} }
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
@override @override
void didUpdateWidget(NumberPickerWidget oldWidget) { void didUpdateWidget(NumberPickerWidget oldWidget) {
//print("value $value initial ${widget.initalValue}");
if (value == 0) {
_scrollController.animateToItem(widget.initalValue, duration: Duration(milliseconds: 100), curve: Curves.easeIn);
}
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
} }
Widget durationPicker({bool inSeconds = false, bool inHundredths = false}) { Widget durationPicker({bool inSeconds = false, bool inHundredths = false}) {
double value = 0;
return CupertinoPicker( return CupertinoPicker(
scrollController: _scrollController, scrollController: _scrollController,
useMagnifier: true, useMagnifier: true,
@ -54,9 +64,11 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
selectionOverlay: Container(), selectionOverlay: Container(),
onSelectedItemChanged: (x) { onSelectedItemChanged: (x) {
currentData = x.toDouble(); currentData = x.toDouble();
value = x.toDouble();
//print("sec" + seconds.toStringAsFixed(2)); //print("sec" + seconds.toStringAsFixed(2));
setState(() {}); setState(() {
value = x.toDouble();
});
widget.onChange(value); widget.onChange(value);
}, },
children: List.generate( children: List.generate(
@ -69,6 +81,7 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setContext(context); setContext(context);
value = 0;
return Container( return Container(
color: Colors.transparent, color: Colors.transparent,
width: MediaQuery.of(context).size.width * .40, width: MediaQuery.of(context).size.width * .40,

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.10+62 version: 1.1.10+63
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"