Fix floating number, menu font size

This commit is contained in:
Bossanyi Tibor 2020-07-08 09:34:34 +02:00
parent 9e6b1f2703
commit eac21c5241
10 changed files with 49 additions and 35 deletions

View File

@ -6,6 +6,7 @@
"TRAINING!": "TRAINING!",
"Login": "Login",
"Logout": "Logout",
"Tests": "Tests",
"Change Language": "Change Language",
"Password too short": "Password too short",
"Please type an email address": "Please type an email address",

View File

@ -3,6 +3,7 @@
"Home": "Főoldal",
"Customers": "Ügyfelek",
"Exercises": "Gyakorlatok",
"Tests": "Tesztek",
"TRAINING!": "EDZÉS!",
"Login": "Bejelentkezés",
"Logout": "Kijelentkezés",

View File

@ -1,4 +1,3 @@
import 'dart:collection';
import 'dart:ui';
class WorkoutTree {
@ -9,8 +8,8 @@ class WorkoutTree {
Color color;
double fontSize;
bool child;
int exercise_type_id;
int exerciseTypeId;
WorkoutTree(this.id, this.parent, this.name, this.imageName, this.color, this.fontSize, this.child, this.exercise_type_id);
WorkoutTree(this.id, this.parent, this.name, this.imageName, this.color, this.fontSize, this.child, this.exerciseTypeId);
}

View File

@ -17,7 +17,7 @@ class CustomerApi {
Future<void> saveCustomer(Customer customer) async {
String body = JsonEncoder().convert(customer.toJson());
print(" ===== saving exerciseType id: " + customer.customerId.toString() + ":" + body );
print(" ===== saving customer id: " + customer.customerId.toString() + ":" + body );
await _client.post(
"customers/"+customer.customerId.toString(),
body);

View File

@ -1,10 +1,10 @@
import 'package:aitrainer_app/util/loading_screen_state.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
/// Loading Screen Widget that updates the screen once all inistializer methods
/// are called
// ignore: must_be_immutable
class LoadingScreen extends StatefulWidget {
/// List of methods that are called once the Loading Screen is rendered
/// for the first time. These are the methods that can update the messages

View File

@ -1,8 +1,6 @@
import 'dart:core';
import 'dart:async';
import 'file:///D:/projects/aitrainer/src/aitrainer_app/lib/util/loading_screen.dart';
import 'package:aitrainer_app/localization/app_language.dart';
import 'package:aitrainer_app/localization/app_localization.dart';
import 'package:aitrainer_app/util/loading_screen.dart';
import 'package:aitrainer_app/widgets/home.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

View File

@ -9,70 +9,70 @@ class MenuTests {
MenuTests(BuildContext context) {
this.tree['Cardio']= WorkoutTree(1, 0, AppLocalizations.of(context).translate("Cardio"),
'asset/menu/1.cardio.png',
Colors.white, 48, false,0);
Colors.white, 32, false,0);
this.tree['Aerobic']= WorkoutTree(2, 1, AppLocalizations.of(context).translate("Aerobic"),
'asset/menu/1.1.aerob.png',
Colors.white, 48, false,0);
Colors.white, 32, false,0);
this.tree['Cooper']= WorkoutTree(21, 2, AppLocalizations.of(context).translate("Cooper"),
'asset/menu/1.1.1.cooper.png',
Colors.white, 48, true,30);
Colors.white, 32, true,30);
this.tree['Anaerobic']= WorkoutTree(3, 1, AppLocalizations.of(context).translate("Anaerobic"),
'asset/menu/1.2.anaerob.png',
Colors.white, 48, false,0);
Colors.white, 32, false,0);
this.tree['300m']= WorkoutTree(22, 3, "300m",
'asset/menu/1.2.1.300m.png',
Colors.white, 48, true,31);
Colors.white, 32, true,31);
this.tree['400m']= WorkoutTree(24, 3, "400m",
'asset/menu/1.2.2.400m.png',
Colors.white, 48, true,32);
Colors.white, 32, true,32);
this.tree['Strength']= WorkoutTree(4, 0, AppLocalizations.of(context).translate("Strength"),
'asset/menu/2.strength.png',
Colors.white, 48, false,0);
Colors.white, 32, false,0);
this.tree['Endurance']= WorkoutTree(5, 4, AppLocalizations.of(context).translate("Endurance"),
'asset/menu/2.1.endurance.png',
Colors.white, 36, false,0);
this.tree['Pullups']= WorkoutTree(6, 5, AppLocalizations.of(context).translate("Pull Ups"),
'asset/menu/2.1.1.pull-ups.png',
Colors.white, 48, true,38);
Colors.white, 32, true,38);
this.tree['Pushups']= WorkoutTree(7, 5, AppLocalizations.of(context).translate("Pushups"),
'asset/menu/2.1.2.pushup.png',
Colors.white, 48, true,33);
Colors.white, 32, true,33);
this.tree['Situps']= WorkoutTree(10, 5, AppLocalizations.of(context).translate("Sit-ups"),
'asset/menu/2.1.3.sit-ups.png',
Colors.white, 48, true,36);
Colors.white, 32, true,36);
this.tree['Squats']= WorkoutTree(11, 5, AppLocalizations.of(context).translate("Squats"),
'asset/menu/2.1.4.squats.png',
Colors.white, 48, true,35);
Colors.white, 32, true,35);
this.tree['TimedPushups']= WorkoutTree(12, 5, AppLocalizations.of(context).translate("Timed Pushups"),
'asset/menu/2.1.5.timedpushup.png',
Colors.white, 32, true,34);
this.tree['Core']= WorkoutTree(43, 5, AppLocalizations.of(context).translate("Core"),
'asset/menu/2.1.6.core.png',
Colors.white, 48, true,45);
Colors.white, 32, true,45);
this.tree['1RM']= WorkoutTree(8, 4, AppLocalizations.of(context).translate("1RM"),
'asset/menu/2.2.1.1RM.png',
Colors.white, 48, false,0);
Colors.white, 32, false,0);
this.tree['Chestpress']= WorkoutTree(13, 8, AppLocalizations.of(context).translate("Chest Press"),
'asset/menu/2.2.1.1.chestpress.png',
Colors.white, 48, true,37);
Colors.white, 32, true,37);
this.tree['PullUps1rm']= WorkoutTree(14, 8, AppLocalizations.of(context).translate("Pull Ups"),
'asset/menu/2.2.1.2.pullups.png',
Colors.white, 48, true, 38);
Colors.white, 32, true, 38);
this.tree['Biceps']= WorkoutTree(15, 8, AppLocalizations.of(context).translate("Biceps"),
'asset/menu/2.2.1.3.biceps.png',
Colors.white, 48, true, 39);
Colors.white, 32, true, 39);
this.tree['Triceps']= WorkoutTree(16, 8, AppLocalizations.of(context).translate("Triceps"),
'asset/menu/2.2.1.4.triceps.png',
Colors.white, 48, true, 40);
Colors.white, 32, true, 40);
this.tree['Shoulders']= WorkoutTree(17, 8, AppLocalizations.of(context).translate("Shoulders"),
'asset/menu/2.2.1.5.shoulders.png',
Colors.white, 48, true, 41);
Colors.white, 32, true, 41);
this.tree['BodyCompositions']= WorkoutTree(9, 0, AppLocalizations.of(context).translate("Body Compositions"),
'asset/menu/3.bcs1.png',
Colors.white, 40, false,0);
Colors.white, 32, false,0);
this.tree['BMI']= WorkoutTree(18, 9, AppLocalizations.of(context).translate("BMI"),
'asset/menu/3.1.BMI.png',
Colors.white, 32, true,42);
@ -81,7 +81,7 @@ class MenuTests {
Colors.white, 32, true,0);
this.tree['Sizes']= WorkoutTree(20, 9, AppLocalizations.of(context).translate("Sizes"),
'asset/menu/3.3.sizes.png',
Colors.black, 48, true,0);
Colors.white, 32, true,0);
}

View File

@ -1,6 +1,7 @@
import 'package:aitrainer_app/localization/app_language.dart';
import 'package:aitrainer_app/localization/app_localization.dart';
import 'package:aitrainer_app/viewmodel/exercise_changing_view_model.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -153,6 +154,9 @@ class _ExerciseNewPageState extends State {
validator: (input) {
return validateNumberInput(input);
},
inputFormatters: [
WhitelistingTextInputFormatter(RegExp(r"[\d.]"))
],
onFieldSubmitted: (input) => {
print ("UnitQuantity value $input"),
model.exerciseViewModel.setUnitQuantity(
@ -186,6 +190,9 @@ class _ExerciseNewPageState extends State {
validator: (input) {
return validateNumberInput(input);
},
inputFormatters: [
WhitelistingTextInputFormatter(RegExp(r"[\d.]"))
],
onFieldSubmitted: (input) =>
{
print ("Quantity value $input"),
@ -212,11 +219,19 @@ class _ExerciseNewPageState extends State {
return null;
}
Pattern pattern = r'^\d+(?:\.\d+)?$';
RegExp regex = new RegExp(pattern);
if (!regex.hasMatch(input)) {
return error;
}
rc = double.tryParse(input);
if ( rc == null ) {
return error;
}
if ( ! ( double.parse(input) < 10000 && double.parse(input) > 0) ) {
return error;
}

View File

@ -1,3 +1,4 @@
import 'package:aitrainer_app/localization/app_localization.dart';
import 'package:aitrainer_app/model/auth.dart';
import 'package:aitrainer_app/model/exercise_type.dart';
import 'package:aitrainer_app/model/workout_tree.dart';
@ -36,8 +37,9 @@ class _MenuPageState extends State<MenuPage> {
appBar: AppBar(
backgroundColor: Colors.transparent,
title: Row(
mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(AppLocalizations.of(context).translate("Tests")),
Image.asset(
'asset/image/WT_long_logo.png',
fit: BoxFit.cover,
@ -46,7 +48,7 @@ class _MenuPageState extends State<MenuPage> {
],
),
leading: IconButton(
icon: Icon(Icons.arrow_back, color: Colors.black),
icon: Icon(Icons.arrow_back, color: Colors.white),
onPressed: () => {
this.setState(() {
widget.parent = 0;
@ -104,7 +106,7 @@ class _MenuPageState extends State<MenuPage> {
},
),
} else {
exerciseType = Common.getExerciseType(workoutTree.exercise_type_id),
exerciseType = Common.getExerciseType(workoutTree.exerciseTypeId),
model.setExerciseType(exerciseType),
model.setCustomer(Auth().userLoggedIn),
if ( Auth().userLoggedIn == null ) {

View File

@ -1,11 +1,9 @@
import 'package:aitrainer_app/util/message_state.dart';
import 'package:aitrainer_app/util/session.dart';
import 'package:aitrainer_app/view/menu_page.dart';
import 'package:aitrainer_app/widgets/bottom_nav.dart';
import 'package:aitrainer_app/widgets/home.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'file:///D:/projects/aitrainer/src/aitrainer_app/lib/util/loading_screen.dart';
import 'package:aitrainer_app/util/loading_screen.dart';
class LoadingScreenMain extends StatefulWidget {
@override
@ -44,7 +42,7 @@ class LoadingScreenMainState extends State<LoadingScreenMain> {
class TimeMessages {
static Future timer(MessageState state, Function callback) async {
//while (true) {
await Future.delayed(Duration(seconds: 4), () {
await Future.delayed(Duration(seconds: 2), () {
state.setMessage = DateTime.now().toIso8601String();
print("---- TimeMessages initializer");
Session session = Session();