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
+3 -1
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();
+18 -9
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(
@@ -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(),
+3 -1
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");
});
}
});