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",
"No": "No",
"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?",
"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",

View File

@ -275,6 +275,7 @@
"select your places by tapping":"kattints az edzéshelyszínre",
"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 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",
"Equipment Filter":"Eszköz szűrő",
"Live-Server":"Live-Server",

View File

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

View File

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

View File

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

View File

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

View File

@ -41,8 +41,8 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
TimerBloc timerBloc = BlocProvider.of<TimerBloc>(context);
return BlocProvider(
create: (context) => ExerciseControlBloc(exerciseRepository: exerciseRepository, readonly: readonly, timerBloc: timerBloc)
..add(ExerciseControlLoad()),
create: (context) => ExerciseControlBloc(exerciseRepository: exerciseRepository, readonly: readonly, timerBloc: timerBloc),
//..add(ExerciseControlLoad()),
child: BlocConsumer<ExerciseControlBloc, ExerciseControlState>(listener: (context, state) {
if (state is ExerciseControlError) {
ScaffoldMessenger.of(context).showSnackBar(
@ -260,6 +260,7 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
Widget numberPickForm(ExerciseControlBloc exerciseBloc, int step) {
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:");
LinkedHashMap args = LinkedHashMap();
@ -301,8 +302,8 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
TextSpan(text: t("hu_with") + " "),
TextSpan(
text: strTimes + " ",
style: GoogleFonts.inter(
fontSize: 16,
style: GoogleFonts.archivoBlack(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.yellow[100],
)),
@ -318,7 +319,7 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
NumberPickerWidget(
minValue: 0,
maxValue: 200,
initalValue: exerciseBloc.quantity.round(),
initalValue: exerciseBloc.origQuantity.round(),
unit: t("reps"),
color: Colors.yellow[50]!,
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 {
late double changedValue;
double? changedValue;
@override
Widget build(BuildContext context) {
changedValue = widget.exerciseBloc.unitQuantity;
setContext(context);
return Dialog(
shape: RoundedRectangleBorder(
@ -431,12 +431,21 @@ class _UnitQuantityControlState extends State<UnitQuantityControl> with Trans {
initalValue: widget.exerciseBloc.unitQuantity.round(),
unit: t("kg"),
color: Colors.yellow[50]!,
onChange: (value) => {changedValue = value}),
onChange: (value) => {
setState(() {
changedValue = value;
})
}),
Align(
alignment: Alignment.center,
child: GestureDetector(
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(),
},
child: Stack(

View File

@ -240,7 +240,9 @@ class _ExercisePlanDetailAddPage extends State<ExercisePlanDetailAddPage> with T
initialValue: bloc.quantityUnit.toStringAsFixed(0),
keyboardType: TextInputType.numberWithOptions(decimal: true),
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(),
Divider(),

View File

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

View File

@ -151,7 +151,7 @@ class Search extends StatelessWidget with Trans {
searchBoxDecoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 15, top: 5, bottom: 5),
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,
filled: true,
border: OutlineInputBorder(

View File

@ -30,6 +30,7 @@ class NumberPickerWidget extends StatefulWidget {
class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
late FixedExtentScrollController _scrollController;
double value = 0;
@override
void initState() {
@ -38,13 +39,22 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
_scrollController.animateToItem(widget.initalValue, duration: Duration(milliseconds: 100), curve: Curves.easeIn);
}
@override
void dispose() {
_scrollController.dispose();
super.dispose();
}
@override
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);
}
Widget durationPicker({bool inSeconds = false, bool inHundredths = false}) {
double value = 0;
return CupertinoPicker(
scrollController: _scrollController,
useMagnifier: true,
@ -54,9 +64,11 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
selectionOverlay: Container(),
onSelectedItemChanged: (x) {
currentData = x.toDouble();
value = x.toDouble();
//print("sec" + seconds.toStringAsFixed(2));
setState(() {});
setState(() {
value = x.toDouble();
});
widget.onChange(value);
},
children: List.generate(
@ -69,6 +81,7 @@ class _NumberPickerWidgetState extends State<NumberPickerWidget> with Trans {
@override
Widget build(BuildContext context) {
setContext(context);
value = 0;
return Container(
color: Colors.transparent,
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.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.10+62
version: 1.1.10+63
environment:
sdk: ">=2.12.0 <3.0.0"