wt1.1.1 translation fixes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:aitrainer_app/animations/test_progress_animation.dart';
|
||||
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
|
||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
@@ -12,7 +11,7 @@ import 'package:percent_indicator/linear_percent_indicator.dart';
|
||||
import 'package:rainbow_color/rainbow_color.dart';
|
||||
|
||||
|
||||
class AppBarNav extends StatefulWidget implements PreferredSizeWidget {
|
||||
class AppBarNav extends StatefulWidget implements PreferredSizeWidget {
|
||||
final MenuBloc menuBloc;
|
||||
const AppBarNav({this.menuBloc});
|
||||
|
||||
@@ -86,6 +85,8 @@ class _AppBarNav extends State<AppBarNav> with SingleTickerProviderStateMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
menuBloc = BlocProvider.of<MenuBloc>(context);
|
||||
//setContext(context);
|
||||
|
||||
return AppBar(
|
||||
backgroundColor: Colors.black,
|
||||
title: Row(
|
||||
@@ -128,11 +129,13 @@ class _AppBarNav extends State<AppBarNav> with SingleTickerProviderStateMixin {
|
||||
}
|
||||
int sizeExerciseList = Cache().getExercises() == null? 0 : Cache().getExercises().length;
|
||||
if ( sizeExerciseList == 0 ) {
|
||||
String text = AppLocalizations.of(context).translate("Make your first test");
|
||||
double fontSize = text.length > 15 ? 10 : 16;
|
||||
return Stack(
|
||||
alignment: Alignment.topLeft,
|
||||
children: [
|
||||
Text(AppLocalizations.of(context).translate("Make your first test"),
|
||||
style: TextStyle(fontSize: 16, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]),
|
||||
Text(text,
|
||||
style: TextStyle(fontSize: fontSize, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]),
|
||||
|
||||
),
|
||||
//TestProgress(animation: sizeAnim),
|
||||
|
||||
@@ -97,11 +97,13 @@ class _AppBarCommonNav extends State<AppBarCommonNav> with SingleTickerProvider
|
||||
}
|
||||
int sizeExerciseList = Cache().getExercises() == null? 0 : Cache().getExercises().length;
|
||||
if ( sizeExerciseList == 0 ) {
|
||||
String text = AppLocalizations.of(context).translate("Make your first test");
|
||||
double fontSize = text.length > 17 ? 10 : 16;
|
||||
return Stack(
|
||||
alignment: Alignment.topLeft,
|
||||
children: [
|
||||
Text(AppLocalizations.of(context).translate("Make your first test"),
|
||||
style: TextStyle(fontSize: 16, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]),
|
||||
Text(text,
|
||||
style: TextStyle(fontSize: fontSize, color: colorAnim.value, shadows: [Shadow(color: Colors.purple , blurRadius: 15)]),
|
||||
|
||||
),
|
||||
//TestProgress(animation: sizeAnim),
|
||||
|
||||
+13
-7
@@ -36,17 +36,18 @@ class _HomePageState extends State<AitrainerHome> {
|
||||
}
|
||||
|
||||
Future runDelayedEvent() async {
|
||||
await Future.delayed(Duration(seconds: 3), () async {
|
||||
await Future.delayed(Duration(seconds: 2), () async {
|
||||
if ( context != null) {
|
||||
// ignore: close_sinks
|
||||
SessionBloc sessionBloc = BlocProvider.of<SessionBloc>(context);
|
||||
if (sessionBloc.state != SessionReady()) {
|
||||
sessionBloc.add(SessionStart());
|
||||
// ignore: close_sinks
|
||||
SettingsBloc settingsBloc = BlocProvider.of<SettingsBloc>(context);
|
||||
String lang = AppLanguage().appLocal.languageCode;
|
||||
print (" -- Loading delayed lang $lang");
|
||||
settingsBloc.add(SettingsChangeLanguage(language: lang));
|
||||
settingsBloc.context = context;
|
||||
sessionBloc.add(SessionStart(settingsBloc: settingsBloc));
|
||||
//String lang = AppLanguage().appLocal.languageCode;
|
||||
//print (" -- Loading delayed lang $lang");
|
||||
//settingsBloc.add(SettingsChangeLanguage(language: lang));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -59,7 +60,12 @@ class _HomePageState extends State<AitrainerHome> {
|
||||
child: BlocConsumer<SessionBloc, SessionState>(
|
||||
listener: (context, state) {
|
||||
if ( state is SessionFailure) {
|
||||
|
||||
Scaffold.of(context).showSnackBar(SnackBar(
|
||||
content: Text(
|
||||
state.message,
|
||||
),
|
||||
backgroundColor: Colors.orange,
|
||||
));
|
||||
}
|
||||
},
|
||||
builder: (context, state) {
|
||||
@@ -69,7 +75,7 @@ class _HomePageState extends State<AitrainerHome> {
|
||||
print("loading");
|
||||
return LoadingScreenMain();
|
||||
} else if (state is SessionReady) {
|
||||
print("ready");
|
||||
print("ready menu with " + Cache().startPage);
|
||||
if (Cache().startPage == 'login') {
|
||||
return LoginPage();
|
||||
} else if (Cache().startPage == 'registration') {
|
||||
|
||||
@@ -37,7 +37,7 @@ class MenuPageWidget extends StatelessWidget {
|
||||
child: Center(
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomLeft,
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
//clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
children: [
|
||||
FlatButton(
|
||||
child: _getButtonImage(workoutTree),
|
||||
@@ -46,7 +46,7 @@ class MenuPageWidget extends StatelessWidget {
|
||||
onPressed: () => menuClick(workoutTree, menuBloc, context),
|
||||
),
|
||||
Positioned(
|
||||
top: workoutTree.name.length > 30 ? 140 : 150,
|
||||
top: workoutTree.name.length > 15 ? 140 : 150,
|
||||
left: 5,
|
||||
child: Container(
|
||||
height: 300,
|
||||
|
||||
Reference in New Issue
Block a user