WT1.1.5 In-app-purchase
This commit is contained in:
+50
-19
@@ -2,7 +2,6 @@ import 'package:aitrainer_app/bloc/exercise_new/exercise_new_bloc.dart';
|
||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:animated_widgets/widgets/rotation_animated.dart';
|
||||
import 'package:flurry/flurry.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@@ -71,7 +70,6 @@ class _BMIState extends State<BMI> with Trans {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
setContext(context);
|
||||
Flurry.logEvent("BMI");
|
||||
double mediaWidth = MediaQuery.of(context).size.width * .8;
|
||||
double mediaHeight = MediaQuery.of(context).size.height * .8;
|
||||
//print("w " + mediaWidth.toString() + "h " + mediaHeight.toString());
|
||||
@@ -109,18 +107,35 @@ class _BMIState extends State<BMI> with Trans {
|
||||
fontSize: 30,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
Text(widget.exerciseBloc.bmi.toStringAsFixed(1) + "%",
|
||||
style: GoogleFonts.archivoBlack(
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 3.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
fontSize: 60,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(widget.exerciseBloc.bmi.toStringAsFixed(1),
|
||||
style: GoogleFonts.archivoBlack(
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 3.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
fontSize: 60,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
Text(" kg/m2",
|
||||
style: GoogleFonts.archivoBlack(
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 3.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
fontSize: 30,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
],
|
||||
),
|
||||
Divider(color: Colors.transparent),
|
||||
Stack(alignment: Alignment.center, children: [
|
||||
Container(
|
||||
@@ -153,15 +168,31 @@ class _BMIState extends State<BMI> with Trans {
|
||||
color: Colors.yellow[200],
|
||||
)),
|
||||
),
|
||||
Text("BMI" + ": " + widget.exerciseBloc.goalBMI.toStringAsFixed(0),
|
||||
Text("BMI" + " " + t("first step") + ": " + widget.exerciseBloc.goalMilestoneBMI.toStringAsFixed(1),
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontSize: 40,
|
||||
fontSize: 20,
|
||||
color: Colors.orange[200],
|
||||
)),
|
||||
Text(
|
||||
t("Bodyweight") +
|
||||
" " +
|
||||
t("first step") +
|
||||
": " +
|
||||
widget.exerciseBloc.goalMilestoneWeight.toStringAsFixed(0) +
|
||||
" kg",
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontSize: 20,
|
||||
color: Colors.orange[200],
|
||||
)),
|
||||
Text("BMI" + " " + t("goal") + ": " + widget.exerciseBloc.goalBMI.toStringAsFixed(1),
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontSize: 20,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
Text(t("Weight") + ": " + widget.exerciseBloc.goalWeight.toStringAsFixed(0) + " kg",
|
||||
Text(t("Bodyweight") + " " + t("goal") + ": " + widget.exerciseBloc.goalWeight.toStringAsFixed(0) + " kg",
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontSize: 30,
|
||||
color: Colors.orange[200],
|
||||
fontSize: 20,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
]))))));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:aitrainer_app/bloc/exercise_new/exercise_new_bloc.dart';
|
||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/fitness_state.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:flurry/flurry.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
@@ -26,6 +25,7 @@ class _BMRState extends State<BMR> with Trans {
|
||||
|
||||
final FocusNode _nodeText1 = FocusNode();
|
||||
final FocusNode _nodeText2 = FocusNode();
|
||||
final FocusNode _nodeText3 = FocusNode();
|
||||
|
||||
KeyboardActionsConfig _buildConfig(BuildContext context) {
|
||||
return KeyboardActionsConfig(
|
||||
@@ -34,6 +34,21 @@ class _BMRState extends State<BMR> with Trans {
|
||||
keyboardSeparatorColor: Colors.black26,
|
||||
nextFocus: true,
|
||||
actions: [
|
||||
KeyboardActionsItem(focusNode: _nodeText3, toolbarButtons: [
|
||||
(node) {
|
||||
return GestureDetector(
|
||||
onTap: () => node.unfocus(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
color: Colors.orange[500],
|
||||
child: Text(
|
||||
AppLocalizations.of(context).translate("Done"),
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
]),
|
||||
KeyboardActionsItem(focusNode: _nodeText2, toolbarButtons: [
|
||||
(node) {
|
||||
return GestureDetector(
|
||||
@@ -75,7 +90,6 @@ class _BMRState extends State<BMR> with Trans {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
setContext(context);
|
||||
Flurry.logEvent("BMR");
|
||||
return Form(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
@@ -99,6 +113,35 @@ class _BMRState extends State<BMR> with Trans {
|
||||
getWeightInput(),
|
||||
getFitnessLevel(),
|
||||
Divider(),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 35, right: 35),
|
||||
child: Text(t("Resting Metabolic Rate"),
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.archivoBlack(
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 3.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
fontSize: 24,
|
||||
color: Colors.orange[300],
|
||||
)),
|
||||
),
|
||||
Text(widget.exerciseBloc.bmrEnergy.toStringAsFixed(0) + " kCal",
|
||||
style: GoogleFonts.archivoBlack(
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(5.0, 5.0),
|
||||
blurRadius: 3.0,
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
fontSize: 30,
|
||||
color: Colors.orange[300],
|
||||
)),
|
||||
SizedBox(height: 20),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 35, right: 35),
|
||||
child: Text(t("Basal Metabolic Rate"),
|
||||
@@ -111,7 +154,7 @@ class _BMRState extends State<BMR> with Trans {
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
fontSize: 30,
|
||||
fontSize: 24,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
),
|
||||
@@ -124,7 +167,7 @@ class _BMRState extends State<BMR> with Trans {
|
||||
color: Colors.black54,
|
||||
),
|
||||
],
|
||||
fontSize: 50,
|
||||
fontSize: 30,
|
||||
color: Colors.orange[500],
|
||||
)),
|
||||
Container(
|
||||
@@ -168,6 +211,30 @@ class _BMRState extends State<BMR> with Trans {
|
||||
}
|
||||
}
|
||||
|
||||
Widget getBirthyearInput() {
|
||||
return Flexible(
|
||||
child: TextFormField(
|
||||
focusNode: _nodeText3,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.only(left: 15, top: 5, bottom: 5),
|
||||
labelText: AppLocalizations.of(context).translate("Birth Year"),
|
||||
labelStyle: GoogleFonts.inter(fontSize: 16, color: Colors.yellow[50]),
|
||||
fillColor: Colors.black38,
|
||||
filled: true,
|
||||
border: OutlineInputBorder(
|
||||
gapPadding: 4.0,
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
borderSide: BorderSide(color: Colors.white12, width: 0.4),
|
||||
),
|
||||
),
|
||||
initialValue: widget.exerciseBloc.birthYear.toStringAsFixed(0),
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: false),
|
||||
textInputAction: TextInputAction.done,
|
||||
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
|
||||
onChanged: (value) => {widget.exerciseBloc.add(ExerciseNewBirthyearChange(value: int.parse(value)))}),
|
||||
);
|
||||
}
|
||||
|
||||
Widget getFitnessLevel() {
|
||||
String fitnessLevel = widget.exerciseBloc.fitnessLevel;
|
||||
return Container(
|
||||
@@ -254,14 +321,18 @@ class _BMRState extends State<BMR> with Trans {
|
||||
|
||||
Widget getWeightInput() {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(top: 15, left: 65, right: 65, bottom: 10),
|
||||
padding: EdgeInsets.only(top: 15, left: 35, right: 35, bottom: 10),
|
||||
alignment: Alignment.center,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
getBirthyearInput(),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
getHeightInput(),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
width: 5,
|
||||
),
|
||||
Flexible(
|
||||
child: TextFormField(
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:flurry/flurry.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gradient_bottom_navigation_bar/gradient_bottom_navigation_bar.dart';
|
||||
|
||||
@@ -26,9 +26,6 @@ class DialogPremium extends StatefulWidget {
|
||||
: super(key: key) {
|
||||
description = description ?? "";
|
||||
function = function ?? "";
|
||||
unlockedText = unlockedText ?? "";
|
||||
|
||||
unlocked = true;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -92,7 +89,7 @@ class _DialogPremiumState extends State<DialogPremium> with Trans {
|
||||
Text(
|
||||
widget.unlocked ? t("Keep testing") : t("Go Premium") + " ",
|
||||
style: GoogleFonts.archivoBlack(
|
||||
fontSize: widget.unlocked ? 18 : 24,
|
||||
fontSize: widget.unlocked ? 20 : 24,
|
||||
color: Colors.yellow[400],
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
@@ -226,9 +223,10 @@ class _DialogPremiumState extends State<DialogPremium> with Trans {
|
||||
List<TextSpan> getDescriptionText() {
|
||||
List<TextSpan> list = List();
|
||||
|
||||
/* if (widget.unlocked) {
|
||||
if (widget.unlockedText != null) {
|
||||
list.add(TextSpan(text: widget.unlockedText));
|
||||
} */
|
||||
return list;
|
||||
}
|
||||
list.add(TextSpan(text: t("The")));
|
||||
list.add(TextSpan(text: t(" ")));
|
||||
list.add(
|
||||
|
||||
@@ -2,14 +2,12 @@ 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/platform_purchase.dart';
|
||||
import 'package:aitrainer_app/view/login.dart';
|
||||
import 'package:aitrainer_app/view/menu_page.dart';
|
||||
import 'package:aitrainer_app/view/registration.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/semantics.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'loading.dart';
|
||||
|
||||
@@ -8,14 +8,12 @@ import 'package:aitrainer_app/localization/app_localization.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:aitrainer_app/util/not_found_exception.dart';
|
||||
import 'package:aitrainer_app/util/trans.dart';
|
||||
import 'package:aitrainer_app/widgets/dialog_common.dart';
|
||||
import 'package:badges/badges.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
|
||||
@@ -4,21 +4,23 @@ import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class TreeviewParentWidget extends StatelessWidget {
|
||||
final String text;
|
||||
final Color backgroundColor;
|
||||
final Color color;
|
||||
//final DateTime lastModified;
|
||||
|
||||
TreeviewParentWidget({@required this.text});
|
||||
TreeviewParentWidget({@required this.text, this.backgroundColor = Colors.white38, this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget parentWidget = Text(
|
||||
this.text,
|
||||
style: GoogleFonts.archivoBlack(fontSize: 24, color: Colors.blue[800], backgroundColor: Colors.transparent),
|
||||
style: GoogleFonts.archivoBlack(fontSize: 24, color: color ?? Colors.blue[800], backgroundColor: Colors.transparent),
|
||||
);
|
||||
|
||||
Icon icon = Icon(Icons.person);
|
||||
|
||||
return Card(
|
||||
color: Colors.white38,
|
||||
color: backgroundColor,
|
||||
shadowColor: Colors.black54,
|
||||
elevation: 0.0,
|
||||
child: ListTile(
|
||||
|
||||
Reference in New Issue
Block a user