WT 1.1.14+2 sales page update
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:collection';
|
||||
|
||||
import 'package:aitrainer_app/bloc/exercise_control/exercise_control_bloc.dart';
|
||||
import 'package:aitrainer_app/bloc/timer/timer_bloc.dart';
|
||||
import 'package:aitrainer_app/bloc/tutorial/tutorial_bloc.dart';
|
||||
import 'package:aitrainer_app/library/custom_icon_icons.dart';
|
||||
import 'package:aitrainer_app/util/app_language.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
@@ -267,6 +268,7 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
|
||||
|
||||
String title = (step + 1).toString() + "/4 " + t("Control Exercise:");
|
||||
LinkedHashMap args = LinkedHashMap();
|
||||
final TutorialBloc tutorialBloc = BlocProvider.of<TutorialBloc>(context);
|
||||
|
||||
List<Widget> listWidgets = [
|
||||
Text(
|
||||
@@ -332,15 +334,20 @@ class _ExerciseControlPage extends State<ExerciseControlPage> with Trans {
|
||||
primary: Colors.white,
|
||||
onSurface: Colors.blueAccent,
|
||||
),
|
||||
onPressed: () => {
|
||||
exerciseBloc.add(ExerciseControlSubmit(step: step)),
|
||||
if (step == 3)
|
||||
{
|
||||
Navigator.of(context).pop(),
|
||||
args['exerciseRepository'] = exerciseBloc.exerciseRepository,
|
||||
Navigator.of(context).pushNamed('evaluationPage', arguments: args)
|
||||
}
|
||||
},
|
||||
onPressed: () {
|
||||
if (tutorialBloc.isActive) {
|
||||
if (!tutorialBloc.checkAction("Save")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
exerciseBloc.add(ExerciseControlSubmit(step: step));
|
||||
if (step == 3) {
|
||||
Navigator.of(context).pop();
|
||||
args['exerciseRepository'] = exerciseBloc.exerciseRepository;
|
||||
Navigator.of(context).pushNamed('evaluationPage', arguments: args);
|
||||
}
|
||||
},
|
||||
child: step == exerciseBloc.step
|
||||
? Stack(
|
||||
alignment: Alignment.center,
|
||||
|
||||
+170
-47
@@ -1,4 +1,5 @@
|
||||
import 'package:aitrainer_app/bloc/sales/sales_bloc.dart';
|
||||
import 'package:aitrainer_app/library/button_animations.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||
@@ -6,6 +7,8 @@ import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:aitrainer_app/widgets/sales_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import 'package:flutter_html/style.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
|
||||
|
||||
@@ -22,7 +25,6 @@ class SalesPage extends StatelessWidget with Trans, Logging {
|
||||
create: (context) => SalesBloc()..add(SalesLoad()),
|
||||
child: BlocConsumer<SalesBloc, SalesState>(listener: (context, state) {
|
||||
if (state is SalesError) {
|
||||
log("Error: " + state.message);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(backgroundColor: Colors.orange, content: Text(t(state.message), style: TextStyle(color: Colors.white))));
|
||||
} else if (state is SalesSuccessful) {
|
||||
@@ -57,6 +59,9 @@ class SalesPage extends StatelessWidget with Trans, Logging {
|
||||
}
|
||||
|
||||
Widget salesWidget(SalesBloc bloc) {
|
||||
final salesText = bloc.salesText != null ? bloc.salesText! : "";
|
||||
final String html = salesText;
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
@@ -68,55 +73,144 @@ class SalesPage extends StatelessWidget with Trans, Logging {
|
||||
child: CustomScrollView(scrollDirection: Axis.vertical, slivers: [
|
||||
SliverList(
|
||||
delegate: SliverChildListDelegate([
|
||||
Divider(),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 65, right: 65),
|
||||
child: Text(t("Unleash Your Development Now!"),
|
||||
Html(
|
||||
data: html,
|
||||
//Optional parameters:
|
||||
style: {
|
||||
"p": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(16),
|
||||
padding: const EdgeInsets.only(left: 20, right: 8, bottom: 4),
|
||||
),
|
||||
"strong": Style(
|
||||
color: Colors.yellow[600],
|
||||
fontSize: FontSize(16),
|
||||
),
|
||||
"h3": Style(
|
||||
color: Colors.yellow[600],
|
||||
fontSize: FontSize(16),
|
||||
textAlign: TextAlign.center,
|
||||
padding: const EdgeInsets.all(12),
|
||||
),
|
||||
"li": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(14),
|
||||
padding: const EdgeInsets.only(left: 20, bottom: 10, right: 8),
|
||||
//before: "*",
|
||||
display: Display.LIST_ITEM),
|
||||
"h2": Style(
|
||||
color: Colors.yellow[600],
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: FontSize(24),
|
||||
textAlign: TextAlign.center,
|
||||
//padding: const EdgeInsets.all(4),
|
||||
),
|
||||
"h1": Style(
|
||||
color: Colors.yellow[400],
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: FontSize.larger,
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.all(4),
|
||||
),
|
||||
},
|
||||
), // final Color bgrColor = Color(0xffb4f500);
|
||||
//final Color bgrColorEnd = Colors.blue;
|
||||
AnimatedButton(
|
||||
child: Html(
|
||||
data: bloc.salesButtonText,
|
||||
//Optional parameters:
|
||||
style: {
|
||||
"p": Style(
|
||||
color: Colors.black,
|
||||
fontSize: FontSize(16),
|
||||
padding: const EdgeInsets.all(4),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 4,
|
||||
softWrap: true,
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontSize: 30,
|
||||
color: Colors.white,
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
Shadow(
|
||||
offset: Offset(-3.0, 3.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
))),
|
||||
Divider(),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 45, right: 45),
|
||||
child: Text(t("Learn about your development, enjoy AI-driven predictions of all of your skills and bodyparts."),
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 4,
|
||||
softWrap: true,
|
||||
style: GoogleFonts.inter(
|
||||
fontSize: 16,
|
||||
color: Colors.white,
|
||||
))),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
textShadow: [
|
||||
Shadow(
|
||||
offset: Offset(2.0, 2.0),
|
||||
blurRadius: 6.0,
|
||||
color: Colors.black54,
|
||||
)
|
||||
],
|
||||
),
|
||||
"li": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(14),
|
||||
padding: const EdgeInsets.only(left: 10, bottom: 10),
|
||||
before: "*",
|
||||
),
|
||||
"h2": Style(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: FontSize.larger,
|
||||
textAlign: TextAlign.center,
|
||||
textShadow: [
|
||||
Shadow(
|
||||
offset: Offset(2.0, 2.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
)
|
||||
],
|
||||
//padding: const EdgeInsets.all(4),
|
||||
),
|
||||
"h1": Style(
|
||||
color: Colors.yellow[600],
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: FontSize.xLarge,
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.all(4),
|
||||
textAlign: TextAlign.center,
|
||||
textShadow: [
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 12.0,
|
||||
color: Colors.black54,
|
||||
)
|
||||
],
|
||||
),
|
||||
},
|
||||
),
|
||||
duration: 600,
|
||||
darkShadow: true,
|
||||
blurRadius: 12,
|
||||
animationCurve: Curves.easeIn,
|
||||
height: 120,
|
||||
width: 320,
|
||||
onTap: () => bloc.add(SalesPurchase(productId: bloc.offeredProduct!.productId)),
|
||||
//color: Color(0xffb4f500),
|
||||
isMultiColor: true,
|
||||
colors: [
|
||||
Colors.blue,
|
||||
Color(0xffb4f500),
|
||||
Color(0xffb4f500),
|
||||
],
|
||||
),
|
||||
])),
|
||||
SliverGrid(
|
||||
delegate: SliverChildListDelegate(getButtons(bloc)),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
mainAxisSpacing: 10.0,
|
||||
crossAxisSpacing: 10.0,
|
||||
childAspectRatio: 0.55,
|
||||
|
||||
getTrialDescription(),
|
||||
//Divider(),
|
||||
AnimatedButton(
|
||||
child: Html(
|
||||
data: "<p>" + t("View other alternatives") + "</p>",
|
||||
//Optional parameters:
|
||||
style: {
|
||||
"p": Style(
|
||||
color: Colors.black,
|
||||
fontSize: FontSize(14),
|
||||
padding: const EdgeInsets.all(4),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
},
|
||||
),
|
||||
onTap: () => bloc.add(SalesChangeSubscription()),
|
||||
width: 320,
|
||||
blurRadius: 6,
|
||||
isMultiColor: true,
|
||||
colors: [
|
||||
Colors.white,
|
||||
Colors.yellow[300]!,
|
||||
],
|
||||
),
|
||||
),
|
||||
SliverList(
|
||||
delegate: SliverChildListDelegate([
|
||||
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
@@ -144,6 +238,35 @@ class SalesPage extends StatelessWidget with Trans, Logging {
|
||||
]));
|
||||
}
|
||||
|
||||
Widget getTrialDescription() {
|
||||
final trialText = t("Try free for 3 days!");
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 55, right: 55),
|
||||
child: Html(
|
||||
data: "<p>" + trialText + "</p>",
|
||||
//Optional parameters:
|
||||
style: {
|
||||
"p": Style(
|
||||
color: Colors.white,
|
||||
fontSize: FontSize(13),
|
||||
padding: const EdgeInsets.all(4),
|
||||
textAlign: TextAlign.center,
|
||||
textShadow: [
|
||||
Shadow(
|
||||
offset: Offset(2.0, 2.0),
|
||||
blurRadius: 6.0,
|
||||
color: Colors.black54,
|
||||
)
|
||||
],
|
||||
),
|
||||
"strong": Style(
|
||||
color: Colors.yellow[600],
|
||||
fontSize: FontSize(13),
|
||||
),
|
||||
},
|
||||
));
|
||||
}
|
||||
|
||||
List<Widget> getButtons(SalesBloc bloc) {
|
||||
List<Widget> buttons = [];
|
||||
|
||||
|
||||
+10
-2
@@ -139,7 +139,7 @@ class SettingsPage extends StatelessWidget with Trans {
|
||||
final TutorialBloc tutorialBloc = BlocProvider.of<TutorialBloc>(context);
|
||||
return ListTile(
|
||||
leading: Icon(CustomIcon.question_circle),
|
||||
subtitle: Text("Activating the basic tutorial"),
|
||||
subtitle: Text(t("Activating the basic tutorial")),
|
||||
title: ToggleSwitch(
|
||||
minWidth: 120.0,
|
||||
minHeight: 30.0,
|
||||
@@ -151,7 +151,15 @@ class SettingsPage extends StatelessWidget with Trans {
|
||||
inactiveFgColor: Colors.grey[900],
|
||||
labels: [t('Basic Tutorial'), t('Activate')],
|
||||
onToggle: (index) {
|
||||
settingsBloc.add(SettingsActivateTutorial(activity: ActivityDone.tutorialBasic));
|
||||
ActivityDone activity = ActivityDone.tutorialBasic;
|
||||
if (Cache().userLoggedIn != null) {
|
||||
if (Cache().userLoggedIn!.sex == "m") {
|
||||
activity = ActivityDone.tutorialBasicChestPress;
|
||||
} else {
|
||||
activity = ActivityDone.tutorialBasicLegPress;
|
||||
}
|
||||
}
|
||||
settingsBloc.add(SettingsActivateTutorial(activity: activity));
|
||||
tutorialBloc.add(TutorialStart());
|
||||
},
|
||||
),
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/app_bar.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_html.dart';
|
||||
import 'package:aitrainer_app/widgets/menu_image.dart';
|
||||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@@ -190,12 +191,9 @@ class TestSetEdit extends StatelessWidget with Trans {
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) {
|
||||
return DialogCommon(
|
||||
return DialogHTML(
|
||||
title: bloc.templateNameTranslation,
|
||||
descriptions: bloc.templateDescription,
|
||||
text: "OK",
|
||||
onTap: () => {Navigator.of(context).pop()},
|
||||
onCancel: () => {Navigator.of(context).pop()},
|
||||
htmlData: bloc.templateDescription,
|
||||
);
|
||||
}),
|
||||
child: Icon(
|
||||
|
||||
Reference in New Issue
Block a user