v1.26 ios v2
This commit is contained in:
@@ -38,7 +38,7 @@ class _BottomBarMultipleExercisesState extends State<BottomBarMultipleExercises>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
_controller = ScrollController();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -209,12 +209,12 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
});
|
||||
}
|
||||
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
subscription = stream.listen((event) {
|
||||
//_controller1.text = ExerciseSaveStream().weight.toStringAsFixed(0);
|
||||
_controller2.text = ExerciseSaveStream().repeats.toStringAsFixed(0);
|
||||
});
|
||||
print("ExerciseSave weight ${widget.weight}");
|
||||
//print("ExerciseSave weight ${widget.weight}");
|
||||
_controller1.text = widget.weight == null || widget.weight == -1
|
||||
? "TEST"
|
||||
: widget.weight! % widget.weight!.round() == 0
|
||||
@@ -633,7 +633,8 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
padding: const EdgeInsets.all(2),
|
||||
color: Colors.white70,
|
||||
onPressed: () async {
|
||||
stopWatchTimer.onExecute.add(StopWatchExecute.start);
|
||||
//stopWatchTimer.onExecute.add(StopWatchExecute.start);
|
||||
stopWatchTimer.onStartTimer();
|
||||
Wakelock.enable(); // prevent sleep the phone
|
||||
},
|
||||
icon: Icon(CustomIcon.play_1),
|
||||
@@ -647,7 +648,8 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
iconSize: 40,
|
||||
color: Colors.white70,
|
||||
onPressed: () async {
|
||||
stopWatchTimer.onExecute.add(StopWatchExecute.stop);
|
||||
//stopWatchTimer.onExecute.add(StopWatchExecute.stop);
|
||||
stopWatchTimer.onStartTimer();
|
||||
Wakelock.disable();
|
||||
},
|
||||
icon: Icon(CustomIcon.stop),
|
||||
@@ -660,7 +662,8 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
|
||||
iconSize: 40,
|
||||
color: Colors.white70,
|
||||
onPressed: () async {
|
||||
stopWatchTimer.onExecute.add(StopWatchExecute.reset);
|
||||
//stopWatchTimer.onExecute.add(StopWatchExecute.reset);
|
||||
stopWatchTimer.onResetTimer();
|
||||
},
|
||||
icon: Icon(CustomIcon.creative_commons_zero),
|
||||
),
|
||||
|
||||
+10
-4
@@ -2,7 +2,6 @@ import 'package:aitrainer_app/bloc/session/session_bloc.dart';
|
||||
import 'package:aitrainer_app/bloc/settings/settings_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/app_language.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/view/customer_goal_page.dart';
|
||||
import 'package:aitrainer_app/view/login.dart';
|
||||
@@ -12,6 +11,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:matomo_tracker/matomo_tracker.dart';
|
||||
import 'package:upgrader/upgrader.dart';
|
||||
import 'loading.dart';
|
||||
|
||||
@@ -25,15 +25,21 @@ class AitrainerHome extends StatefulWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _HomePageState extends State<AitrainerHome> with Logging, Trans {
|
||||
class _HomePageState extends State<AitrainerHome> with Logging, Trans, TraceableClientMixin {
|
||||
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
||||
|
||||
@override
|
||||
String get traceName => 'Home';
|
||||
|
||||
@override
|
||||
String get traceTitle => this.widget.toString();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
/// We require the initializers to run after the loading screen is rendered
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
runDelayedEvent();
|
||||
});
|
||||
|
||||
@@ -70,7 +76,7 @@ class _HomePageState extends State<AitrainerHome> with Logging, Trans {
|
||||
return Scaffold(
|
||||
key: _scaffoldKey,
|
||||
body: UpgradeAlert(
|
||||
upgrader: Upgrader(appcastConfig: cfg, messages: MyLocalizedUpgraderMessages(context: context)),
|
||||
upgrader: Upgrader(appcastConfig: cfg, messages: MyLocalizedUpgraderMessages(context: context)),
|
||||
child: BlocConsumer<SessionBloc, SessionState>(listener: (context, state) {
|
||||
if (state is SessionFailure) {
|
||||
showDialog(
|
||||
|
||||
@@ -174,8 +174,8 @@ class _InputDialogState<Event> extends State<InputDialog<Event>> with Trans {
|
||||
children: <Widget>[
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.black26,
|
||||
onSurface: Colors.white,
|
||||
backgroundColor: Colors.black26,
|
||||
disabledBackgroundColor: Colors.white,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
@@ -187,8 +187,8 @@ class _InputDialogState<Event> extends State<InputDialog<Event>> with Trans {
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.orange[600],
|
||||
onSurface: Colors.white,
|
||||
backgroundColor: Colors.orange[600],
|
||||
disabledForegroundColor: Colors.white,
|
||||
),
|
||||
onPressed: () {
|
||||
widget.onChanged(this.inputValue);
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
import 'package:aitrainer_app/repository/training_plan_repository.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:aitrainer_app/util/track.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_trial.dart';
|
||||
import 'package:aitrainer_app/widgets/menu_image.dart';
|
||||
import 'package:aitrainer_app/widgets/menu_search_bar.dart';
|
||||
import 'package:aitrainer_app/util/app_language.dart';
|
||||
@@ -55,7 +54,7 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
}
|
||||
|
||||
/// We require the initializers to run after the loading screen is rendered
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
menuBloc.add(MenuCreate());
|
||||
});
|
||||
|
||||
@@ -112,7 +111,9 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
|
||||
return Stack(children: [
|
||||
CustomScrollView(
|
||||
controller: scrollController, scrollDirection: Axis.vertical, slivers: buildMenuColumn(widget.parent!, context, menuBloc, cWidth, cHeight)),
|
||||
controller: scrollController,
|
||||
scrollDirection: Axis.vertical,
|
||||
slivers: buildMenuColumn(widget.parent!, context, menuBloc, cWidth, cHeight)),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -134,7 +135,8 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
padding: EdgeInsets.only(top: 15.0),
|
||||
child: Center(
|
||||
child: Stack(alignment: Alignment.bottomLeft, children: [
|
||||
Text(AppLocalizations.of(context)!.translate("All Exercises has been filtered out"), style: GoogleFonts.inter(color: Colors.white)),
|
||||
Text(AppLocalizations.of(context)!.translate("All Exercises has been filtered out"),
|
||||
style: GoogleFonts.inter(color: Colors.white)),
|
||||
]))));
|
||||
} else {
|
||||
menuBloc.getFilteredBranch(menuBloc.parent).forEach((treeName, value) {
|
||||
@@ -395,8 +397,10 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
|
||||
dynamic getShape(WorkoutMenuTree workoutTree) {
|
||||
bool base = workoutTree.base;
|
||||
dynamic returnCode = (base == true)
|
||||
? RoundedRectangleBorder(side: BorderSide(width: 6, color: Colors.orangeAccent), borderRadius: BorderRadius.all(Radius.circular(24.0)))
|
||||
: RoundedRectangleBorder(side: BorderSide(width: 1, color: Colors.transparent), borderRadius: BorderRadius.all(Radius.circular(8.0)));
|
||||
? RoundedRectangleBorder(
|
||||
side: BorderSide(width: 6, color: Colors.orangeAccent), borderRadius: BorderRadius.all(Radius.circular(24.0)))
|
||||
: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: Colors.transparent), borderRadius: BorderRadius.all(Radius.circular(8.0)));
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ class TutorialWidget with Trans, Logging {
|
||||
children: [
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
onPressed: () => {bloc.add(TutorialNext(text: bloc.checks[0]))},
|
||||
child: Text("« " + t(bloc.checks[0]),
|
||||
@@ -186,7 +186,7 @@ class TutorialWidget with Trans, Logging {
|
||||
),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
onPressed: () => {bloc.add(TutorialNext(text: bloc.checks[1]))},
|
||||
child: Text(t(bloc.checks[1]) + " »",
|
||||
@@ -196,7 +196,7 @@ class TutorialWidget with Trans, Logging {
|
||||
)
|
||||
: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.transparent,
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
onPressed: () => {
|
||||
//tooltip!.rebuild(context),
|
||||
|
||||
@@ -16,7 +16,7 @@ class _VictoryConfettiState extends State<VictoryConfetti> {
|
||||
@override
|
||||
void initState() {
|
||||
_controllerBottomCenter = ConfettiController(duration: const Duration(seconds: 2));
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) {
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
Future.delayed(Duration(milliseconds: 500)).then((value) => _controllerBottomCenter.play());
|
||||
});
|
||||
super.initState();
|
||||
|
||||
Reference in New Issue
Block a user