WT1.1.17 +4 pointer fix

This commit is contained in:
bossanyit
2021-05-16 23:48:57 +02:00
parent 7b0d15aede
commit 4b6b4dafc7
18 changed files with 187 additions and 93 deletions
+54 -28
View File
@@ -209,29 +209,6 @@ class _BMIState extends State<BMI> with Trans {
)
],
),
/* Stack(alignment: Alignment.center, children: [
Container(
padding: EdgeInsets.only(left: 30, right: 30),
child: Image.asset(
"asset/image/BMI_graph_C.png",
),
),
Positioned(
top: widget.exerciseBloc.bmiTop,
left: widget.exerciseBloc.bmiLeft,
child:
Container() RotationAnimatedWidget.tween(
enabled: true,
duration: const Duration(milliseconds: 1000),
rotationDisabled: Rotation.deg(),
rotationEnabled: Rotation.deg(z: widget.exerciseBloc.bmiAngle),
child: Image.asset(
"asset/image/BMI_mutato.png",
width: 65,
))
)
]), */
Divider(color: Colors.transparent),
Container(
padding: EdgeInsets.only(left: 65, right: 65),
@@ -335,8 +312,11 @@ class _BMIState extends State<BMI> with Trans {
keyboardType: TextInputType.numberWithOptions(decimal: false),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) =>
{value = value.replaceFirst(",", "."), widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value)))}),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value))),
}),
);
} else {
return Container();
@@ -355,7 +335,50 @@ class _BMIState extends State<BMI> with Trans {
width: 10,
),
Flexible(
child: TextFormField(
child:
/* SfLinearGauge(
minimum: widget.exerciseBloc.weight > 0 ? (widget.exerciseBloc.weight - 10).floor().toDouble() : 40,
maximum: widget.exerciseBloc.weight > 0 ? (widget.exerciseBloc.weight + 10).ceil().toDouble() : 150,
labelPosition: LinearLabelPosition.outside,
tickPosition: LinearElementPosition.outside,
markerPointers: [
LinearWidgetPointer(
value: widget.exerciseBloc.weight,
offset: 5,
position: LinearElementPosition.outside,
markerAlignment: LinearMarkerAlignment.center,
child: Container(
height: 14,
width: 44,
color: Colors.transparent,
child: Text(widget.exerciseBloc.weight.toStringAsFixed(1),
style: GoogleFonts.inter(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.white,
)),
),
),
LinearShapePointer(
position: LinearElementPosition.inside,
shapeType: LinearShapePointerType.triangle,
value: widget.exerciseBloc.weight,
height: 45,
width: 20,
color: Colors.yellow[200],
onValueChanged: (value) => {widget.exerciseBloc.add(ExerciseNewWeightChange(value: value))},
),
],
orientation: LinearGaugeOrientation.horizontal,
majorTickStyle: LinearTickStyle(length: 20, color: Colors.yellow[50]),
axisLabelStyle: TextStyle(fontSize: 12.0, color: Colors.yellow[50]),
axisTrackStyle: LinearAxisTrackStyle(
color: Colors.cyan,
edgeStyle: LinearEdgeStyle.bothFlat,
thickness: 1.0,
borderColor: Colors
.grey)), */
TextFormField(
focusNode: _nodeText1,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 15, top: 5, bottom: 5),
@@ -373,8 +396,11 @@ class _BMIState extends State<BMI> with Trans {
keyboardType: TextInputType.numberWithOptions(decimal: true),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) =>
{value = value.replaceFirst(",", "."), widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value)))},
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value))),
},
),
),
IconButton(
+14 -5
View File
@@ -216,8 +216,11 @@ class _BMRState extends State<BMR> with Trans {
keyboardType: TextInputType.numberWithOptions(decimal: false),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) =>
{value = value.replaceFirst(",", "."), widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value)))}),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value))),
}),
);
} else {
return Container();
@@ -244,7 +247,10 @@ class _BMRState extends State<BMR> with Trans {
keyboardType: TextInputType.numberWithOptions(decimal: false),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {widget.exerciseBloc.add(ExerciseNewBirthyearChange(value: int.parse(value)))}),
onChanged: (value) => {
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewBirthyearChange(value: int.parse(value)))
}),
);
}
@@ -366,8 +372,11 @@ class _BMRState extends State<BMR> with Trans {
keyboardType: TextInputType.numberWithOptions(decimal: true),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) =>
{value = value.replaceFirst(",", "."), widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value)))},
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value))),
},
),
),
IconButton(
+1
View File
@@ -257,6 +257,7 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
style: GoogleFonts.archivoBlack(fontSize: 80, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.onUnitQuantityChanged!(value),
}),
]));
+5 -1
View File
@@ -156,7 +156,11 @@ class _InputDialogState<Event> extends State<InputDialog<Event>> with Trans {
keyboardType: TextInputType.numberWithOptions(decimal: true),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {value = value.replaceFirst(",", "."), this.inputValue = double.parse(value)},
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
this.inputValue = double.parse(value),
},
),
),
SizedBox(