WT 1.1.11+5 bug fixes customer change

This commit is contained in:
bossanyit 2021-04-12 22:15:33 +02:00
parent db103a1015
commit d1c31b6d25
10 changed files with 48 additions and 45 deletions

View File

@ -438,6 +438,7 @@
"Development":"Development", "Development":"Development",
"How can serve you this result?":"How can serve you this result?", "How can serve you this result?":"How can serve you this result?",
"Go":"Go", "Go":"Go",
"Result":"Result" "Result":"Result",
"Name too short":"Name too short"
} }

View File

@ -433,5 +433,6 @@
"Get the Fastlane to your":"Kapd el a gyorsítósávot a optimális", "Get the Fastlane to your":"Kapd el a gyorsítósávot a optimális",
"Development":"Fejlődésedhez", "Development":"Fejlődésedhez",
"Go":"Érdekel", "Go":"Érdekel",
"Result":"Értékelés" "Result":"Értékelés",
"Name too short":"A név túl rövid"
} }

View File

@ -388,7 +388,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -531,7 +531,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -566,7 +566,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (

View File

@ -3,7 +3,6 @@ import 'dart:async';
import 'package:aitrainer_app/model/cache.dart'; import 'package:aitrainer_app/model/cache.dart';
import 'package:aitrainer_app/repository/customer_repository.dart'; import 'package:aitrainer_app/repository/customer_repository.dart';
import 'package:aitrainer_app/util/common.dart'; import 'package:aitrainer_app/util/common.dart';
import 'package:aitrainer_app/util/trans.dart';
import 'package:bloc/bloc.dart'; import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,7 +13,7 @@ import '../../model/fitness_state.dart';
part 'customer_change_event.dart'; part 'customer_change_event.dart';
part 'customer_change_state.dart'; part 'customer_change_state.dart';
class CustomerChangeBloc extends Bloc<CustomerChangeEvent, CustomerChangeState> with Trans { class CustomerChangeBloc extends Bloc<CustomerChangeEvent, CustomerChangeState> {
final CustomerRepository customerRepository; final CustomerRepository customerRepository;
bool visiblePassword = false; bool visiblePassword = false;
int? year = 1990; int? year = 1990;
@ -138,33 +137,27 @@ class CustomerChangeBloc extends Bloc<CustomerChangeEvent, CustomerChangeState>
} }
bool validation() { bool validation() {
if (customerRepository.customer == null) throw Exception("Customer object not defined");
return true; return true;
/* print("f " + customerRepository.customer.firstname); /* return (emailValidation(customerRepository.customer!.email) == null) &&
return (emailValidation(customerRepository.customer.email) == null) && (passwordValidation(customerRepository.customer!.password) == null) &&
(passwordValidation(customerRepository.customer.password) == null) && (nameValidation(customerRepository.customer!.firstname) == null) &&
(nameValidation(customerRepository.customer.firstname) == null) && (nameValidation(customerRepository.customer!.name) == null); */
(nameValidation(customerRepository.customer.name) == null); */
} }
String? emailValidation(String email) { String? emailValidation(String? email) {
String? message = Common.emailValidation(email); String? message = Common.emailValidation(email);
if (message != null) {
message = t(message);
}
return message; return message;
} }
String? passwordValidation(String value) { String? passwordValidation(String? value) {
String? message = Common.passwordValidation(value); String? message = Common.passwordValidation(value);
if (message != null) {
message = t(message);
}
return message; return message;
} }
String? nameValidation(String? value) { String? nameValidation(String? value) {
if (value == null || value.length == 0) { if (value == null || value.length == 0) {
return t("Name too short"); return "Name too short";
} }
return null; return null;
} }

View File

@ -101,27 +101,27 @@ class CustomerRepository with Logging {
} }
setName(String name) { setName(String name) {
if (this.customer == null) return; if (this.customer == null) throw Exception("Initialize the customer object");
this.customer!.name = name; this.customer!.name = name;
} }
setFirstName(String firstName) { setFirstName(String firstName) {
if (this.customer == null) return; if (this.customer == null) throw Exception("Initialize the customer object");
this.customer!.firstname = firstName; this.customer!.firstname = firstName;
} }
setPassword(String password) { setPassword(String password) {
if (this.customer == null) return; if (this.customer == null) throw Exception("Initialize the customer object");
this.customer!.password = password; this.customer!.password = password;
} }
setEmail(String email) { setEmail(String email) {
if (this.customer == null) return; if (this.customer == null) throw Exception("Initialize the customer object");
this.customer!.email = email; this.customer!.email = email;
} }
setSex(String sex) { setSex(String sex) {
if (this.customer == null) return; if (this.customer == null) throw Exception("Initialize the customer object");
this.customer!.sex = sex; this.customer!.sex = sex;
} }

View File

@ -82,7 +82,12 @@ class _CustomerFitnessPageState extends State<CustomerFitnessPage> with Trans {
Text( Text(
t("Your Fitness State"), t("Your Fitness State"),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.orange, fontSize: 42, fontFamily: 'Arial', fontWeight: FontWeight.w900), style: TextStyle(
color: Colors.orange,
fontSize: 42,
fontFamily: 'Arial',
fontWeight: FontWeight.w900,
),
) )
]), ]),
Divider(), Divider(),

View File

@ -68,14 +68,17 @@ class _CustomerGoalPage extends State<CustomerGoalPage> with Trans {
child: Column( child: Column(
children: [ children: [
Divider(), Divider(),
InkWell( Wrap(alignment: WrapAlignment.center, children: [
child: Text( Text(
AppLocalizations.of(context)!.translate("Set Your Goals"), AppLocalizations.of(context)!.translate("Set Your Goals"),
style: style: GoogleFonts.archivoBlack(
GoogleFonts.archivoBlack(color: Colors.orange, fontSize: 30, fontWeight: FontWeight.w900), color: Colors.orange,
fontSize: 42,
fontWeight: FontWeight.w900,
),
), ),
highlightColor: Colors.white, ]),
), Divider(),
Stack(alignment: Alignment.bottomLeft, children: [ Stack(alignment: Alignment.bottomLeft, children: [
TextButton( TextButton(
style: TextButton.styleFrom( style: TextButton.styleFrom(

View File

@ -114,19 +114,19 @@ class CustomerModifyPage extends StatelessWidget with Trans {
), ),
), ),
initialValue: customerBloc.customerRepository.customer!.email, initialValue: customerBloc.customerRepository.customer!.email,
autovalidateMode: AutovalidateMode.always, autovalidateMode: AutovalidateMode.onUserInteraction,
validator: (val) { validator: (val) {
String? validator = customerBloc.emailValidation(val!); String? validator = customerBloc.emailValidation(val);
return validator == null ? null : t(validator); return validator == null ? null : t(validator);
}, },
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
style: new TextStyle(fontSize: 16, color: Colors.indigo), style: new TextStyle(fontSize: 16, color: Colors.indigo),
) onChanged: (value) => {customerBloc.add(CustomerEmailChange(email: value))})
: Offstage(), : Offstage(),
Divider( Divider(
color: Colors.transparent, color: Colors.transparent,
), ),
Cache().getLoginType() == LoginType.email /* Cache().getLoginType() == LoginType.email
? TextFormField( ? TextFormField(
key: LibraryKeys.loginPasswordField, key: LibraryKeys.loginPasswordField,
obscureText: true, obscureText: true,
@ -149,13 +149,14 @@ class CustomerModifyPage extends StatelessWidget with Trans {
initialValue: customerBloc.customerRepository.customer!.password, initialValue: customerBloc.customerRepository.customer!.password,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
validator: (val) { validator: (val) {
String? validator = customerBloc.passwordValidation(val!); String? validator = customerBloc.passwordValidation(val);
return validator == null ? null : t(validator); return validator == null ? null : t(validator);
}, },
keyboardType: TextInputType.visiblePassword, keyboardType: TextInputType.visiblePassword,
style: new TextStyle(fontSize: 16, color: Colors.indigo), style: new TextStyle(fontSize: 16, color: Colors.indigo),
onChanged: (value) => {customerBloc.add(CustomerPasswordChange(password: value))})
) )
: Offstage(), : Offstage(), */
Divider( Divider(
color: Colors.transparent, color: Colors.transparent,
), ),
@ -175,7 +176,8 @@ class CustomerModifyPage extends StatelessWidget with Trans {
initialValue: customerBloc.customerRepository.customer!.name, initialValue: customerBloc.customerRepository.customer!.name,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
validator: (val) { validator: (val) {
return customerBloc.nameValidation(val); String? validator = customerBloc.nameValidation(val);
return validator == null ? null : t(validator);
}, },
keyboardType: TextInputType.name, keyboardType: TextInputType.name,
style: new TextStyle(fontSize: 16, color: Colors.indigo), style: new TextStyle(fontSize: 16, color: Colors.indigo),
@ -200,7 +202,8 @@ class CustomerModifyPage extends StatelessWidget with Trans {
initialValue: customerBloc.customerRepository.customer!.firstname, initialValue: customerBloc.customerRepository.customer!.firstname,
autovalidateMode: AutovalidateMode.onUserInteraction, autovalidateMode: AutovalidateMode.onUserInteraction,
validator: (val) { validator: (val) {
return customerBloc.nameValidation(val); String? validator = customerBloc.nameValidation(val);
return validator == null ? null : t(validator);
}, },
keyboardType: TextInputType.name, keyboardType: TextInputType.name,
style: new TextStyle(fontSize: 16, color: Colors.indigo), style: new TextStyle(fontSize: 16, color: Colors.indigo),

View File

@ -348,9 +348,6 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
); );
})) }))
: Offstage(), : Offstage(),
SizedBox(
width: 10,
),
])); ]));
return sliverAppBar; return sliverAppBar;
} }

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.10+63 version: 1.1.10+64
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"