WT 1.1.5+2 remote images for menu

This commit is contained in:
bossanyit
2021-01-31 12:59:52 +01:00
parent 71efd3f349
commit c1a57dd10e
88 changed files with 743 additions and 316 deletions
+1 -1
View File
@@ -267,7 +267,7 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
"times!",
);
String title = step.toString() + ". " + t("Control Exercise:");
String title = (step + 1).toString() + "/4 " + t("Control Exercise:");
LinkedHashMap args = LinkedHashMap();
List<Widget> listWidgets = [
+13 -2
View File
@@ -195,7 +195,7 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans, Logging {
Text(
exerciseDescription,
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[300]),
maxLines: 4,
maxLines: 1,
overflow: TextOverflow.fade,
softWrap: true,
),
@@ -231,10 +231,21 @@ class _ExerciseNewPageState extends State<ExerciseNewPage> with Trans, Logging {
color: Colors.transparent,
),
columnQuantity(exerciseBloc),
Divider(),
Divider(
color: Colors.transparent,
),
Text(
t("Step" + ": " + "1/4"),
style: GoogleFonts.inter(
fontSize: 22,
color: Colors.white,
fontWeight: FontWeight.bold,
),
maxLines: 3,
textAlign: TextAlign.center,
overflow: TextOverflow.fade,
softWrap: true,
),
Divider(
color: Colors.transparent,
),
+23 -73
View File
@@ -1,4 +1,3 @@
import 'package:aitrainer_app/bloc/menu/menu_bloc.dart';
import 'package:aitrainer_app/widgets/app_bar.dart';
@@ -6,13 +5,10 @@ import 'package:aitrainer_app/widgets/bottom_nav.dart';
import 'package:aitrainer_app/widgets/menu_page_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
// ignore: must_be_immutable
class MenuPage extends StatefulWidget {
static const routeName = '/menu_page';
int parent;
MenuPage({this.parent});
@@ -24,81 +20,35 @@ class _MenuPage extends State<MenuPage> {
// ignore: close_sinks
MenuBloc menuBloc;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
menuBloc = BlocProvider.of<MenuBloc>(context);
menuBloc.parent = widget.parent;
return Scaffold(
appBar: AppBarNav(isMenu: true,),
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('asset/image/WT_menu_dark.png'),
fit: BoxFit.fill,
alignment: Alignment.center,
),
appBar: AppBarNav(
isMenu: true,
),
child: BlocConsumer<MenuBloc, MenuState>(
listener: (context, state) {
if (state is MenuError) {
Scaffold.of(context).showSnackBar(SnackBar(
backgroundColor: Colors.orange,
content: Text(state.message, style: TextStyle(color: Colors.white))));
} else if ( state is MenuLoading ) {
body: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('asset/image/WT_menu_dark.png'),
fit: BoxFit.fill,
alignment: Alignment.center,
),
),
child: BlocConsumer<MenuBloc, MenuState>(listener: (context, state) {
if (state is MenuError) {
Scaffold.of(context).showSnackBar(
SnackBar(backgroundColor: Colors.orange, content: Text(state.message, style: TextStyle(color: Colors.white))));
}
}, builder: (context, state) {
return MenuPageWidget();
}
},
// ignore: missing_return
builder: (context, state) {
if ( state is MenuInitial ) {
return LoadingMenuDialog();
} else if (state is MenuReady ) {
return MenuPageWidget();
} else if ( state is MenuLoading ) {
return LoadingMenuDialog();
}
}
)
),
bottomNavigationBar: BottomNavigator(bottomNavIndex: 0)
);
})),
bottomNavigationBar: BottomNavigator(bottomNavIndex: 0));
}
}
class LoadingMenuDialog extends StatefulWidget {
LoadingMenuDialog({Key key}) : super(key: key);
@override
State<StatefulWidget> createState() => _LoadingMenuDialog();
}
class _LoadingMenuDialog extends State<LoadingMenuDialog> {
@override
void initState() {
super.initState();
/// We require the initializers to run after the loading screen is rendered
SchedulerBinding.instance.addPostFrameCallback((_) {
BlocProvider.of<MenuBloc>(context).add(MenuCreate());
});
}
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async => false,
child: Center(
child: Card(
child: Container(
width: 80,
height: 80,
padding: EdgeInsets.all(12.0),
child: CircularProgressIndicator(),
color: Colors.transparent,
),
),
),
);
}
}
+1 -1
View File
@@ -98,7 +98,7 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
builder: (BuildContext context) {
return DialogPremium(
unlocked: Cache().hasPurchased,
unlockRound: 1,
unlockRound: 2,
function: "Suggested Training Plan",
unlockedText: null,
onTap: () => {Navigator.of(context).pop()},
+1 -1
View File
@@ -149,7 +149,7 @@ class SalesPage extends StatelessWidget with Trans, Logging {
bloc.product2Display.forEach((element) {
final String title = element.sort == 3 ? t("Montly") : t("Annual");
final String desc4 = element.sort == 1 ? "" : t("AI driven predictions");
final String desc4 = element.sort == 1 ? "" : t("Predictions with Artificial Intelligence");
String badge;
if (element.sort == 2) {
badge = t("14% discount");