WT1.1.7+3 Search bug fix, English translations
This commit is contained in:
@@ -2,7 +2,6 @@ import 'dart:async';
|
||||
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/exercise_ability.dart';
|
||||
import 'package:aitrainer_app/model/property.dart';
|
||||
import 'package:aitrainer_app/model/exercise_type.dart';
|
||||
import 'package:aitrainer_app/model/fitness_state.dart';
|
||||
import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
@@ -71,7 +70,6 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> with Logg
|
||||
height = customerRepository.customer.getProperty("Height");
|
||||
birthYear = customerRepository.customer.birthYear;
|
||||
fitnessLevel = customerRepository.customer.fitnessLevel;
|
||||
|
||||
}
|
||||
if (exerciseType.unit == "second") {
|
||||
stopWatchTimer.rawTime.listen((value) => {timerValue = value, this.setQuantity((value / 1000).toDouble())});
|
||||
@@ -87,14 +85,14 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> with Logg
|
||||
if (this.exerciseRepository.exerciseType.unit != "second") {
|
||||
if (menuBloc.ability.toString() == ExerciseAbility.oneRepMax.toString()) {
|
||||
this.exerciseTask = "Please take a relative bigger weight and repeat 12-20 times";
|
||||
if (init) {
|
||||
if (init == true) {
|
||||
this.setQuantity(12);
|
||||
}
|
||||
} else if (this.exerciseRepository.exerciseType.isEndurance() &&
|
||||
menuBloc.ability.toString() == ExerciseAbility.endurance.toString() &&
|
||||
exerciseRepository.exerciseType.unitQuantity == "1") {
|
||||
this.exerciseTask = "Please take a medium weight and repeat 20-30 times";
|
||||
if (init) {
|
||||
if (init == true) {
|
||||
this.setQuantity(20);
|
||||
}
|
||||
}
|
||||
@@ -230,7 +228,7 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> with Logg
|
||||
if (this.bmi == 0) {
|
||||
getBMI();
|
||||
}
|
||||
final double distortionWidth = mediaWidth / baseWidth;
|
||||
final double distortionWidth = customerRepository.mediaWidth / baseWidth;
|
||||
final double distortionHeight = distortionWidth - 0.02; //mediaHeight / baseHeight;
|
||||
/* log("Width: " +
|
||||
mediaWidth.toStringAsFixed(0) +
|
||||
|
||||
+12
-12
@@ -18,18 +18,18 @@ final temperatureColors = [
|
||||
const Color(0xFF1D0DE2),
|
||||
const Color(0xFF0D4AE2),
|
||||
const Color(0xFF0D57E2),
|
||||
const Color(0xFF0D74E2),
|
||||
const Color(0xFF0DB8E2),
|
||||
const Color(0xFF0DD8E2),
|
||||
const Color(0xFF0DE2BB),
|
||||
const Color(0xFF0DE2A1),
|
||||
const Color(0xFF0DE284),
|
||||
const Color(0xFF0DE25E),
|
||||
const Color(0xFF0DE244),
|
||||
const Color(0xFF84E20D),
|
||||
const Color(0xFFC2E20D),
|
||||
const Color(0xFFE2DF0D),
|
||||
const Color(0xFFE2A10D),
|
||||
const Color(0xFF012e7d),
|
||||
const Color(0xFF01417d),
|
||||
const Color(0xFF01737d),
|
||||
const Color(0xFF017d71),
|
||||
const Color(0xFF017d49),
|
||||
const Color(0xFF017d1c),
|
||||
const Color(0xFF317d01),
|
||||
const Color(0xFF477d01),
|
||||
const Color(0xFF607d01),
|
||||
const Color(0xFF7d7d01),
|
||||
const Color(0xFF7d6001),
|
||||
const Color(0xFF7d4701),
|
||||
const Color(0xFFE2740D),
|
||||
const Color(0xFFE2510D),
|
||||
const Color(0xFFE22D0D),
|
||||
|
||||
@@ -119,8 +119,7 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans, Logging {
|
||||
..add(ExerciseNewLoad()),
|
||||
child: BlocConsumer<ExerciseNewBloc, ExerciseNewState>(
|
||||
listener: (context, state) {
|
||||
if (state is ExerciseNewLoading) {
|
||||
} else if (state is ExerciseNewError) {
|
||||
if (state is ExerciseNewError) {
|
||||
Scaffold.of(context).showSnackBar(
|
||||
SnackBar(backgroundColor: Colors.orange, content: Text(state.message, style: TextStyle(color: Colors.white))));
|
||||
}
|
||||
@@ -163,7 +162,7 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans, Logging {
|
||||
return SizeWidget(exerciseBloc: exerciseBloc);
|
||||
}
|
||||
|
||||
final String exerciseTask = exerciseBloc.setExerciseTask();
|
||||
final String exerciseTask = exerciseBloc.setExerciseTask(init: true);
|
||||
|
||||
return Form(
|
||||
child: Scaffold(
|
||||
@@ -443,6 +442,8 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans, Logging {
|
||||
LinkedHashMap args = LinkedHashMap();
|
||||
print("quantity: " + bloc.quantity.toString());
|
||||
if (bloc.exerciseRepository.exercise.quantity == null) {
|
||||
print("Repository quantity modify");
|
||||
//bloc.exerciseRepository.exercise.quantity = bloc.quantity;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:aitrainer_app/model/exercise_ability.dart';
|
||||
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
import 'package:aitrainer_app/library/custom_icon_icons.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
@@ -270,9 +270,17 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
)),
|
||||
MenuSearchBar(
|
||||
listItems: menuBloc.menuTreeRepository.menuAsExercise,
|
||||
onFind: (value) => {
|
||||
Track().track(TrackingEvent.search, eventValue: value.exerciseType.name),
|
||||
Navigator.of(context).pushNamed('exerciseNewPage', arguments: value.exerciseType)
|
||||
onFind: (value) {
|
||||
print("onFind: ${value.toJson()}");
|
||||
if (Cache().userLoggedIn == null) {
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
backgroundColor: Colors.orange,
|
||||
content: Text(AppLocalizations.of(context).translate('Please log in'), style: TextStyle(color: Colors.white))));
|
||||
} else {
|
||||
Track().track(TrackingEvent.search, eventValue: value.exerciseType.name);
|
||||
menuBloc.ability = ExerciseAbility.oneRepMax;
|
||||
Navigator.of(context).pushNamed('exerciseNewPage', arguments: value.exerciseType);
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
Reference in New Issue
Block a user