WT 1.1.5 ios: apple login - remove unnecessary fields
This commit is contained in:
parent
ef2bd04a3a
commit
3c5360f224
@ -337,5 +337,7 @@
|
|||||||
|
|
||||||
"Or type the time manually:":"Or type the time manually",
|
"Or type the time manually:":"Or type the time manually",
|
||||||
"sec":"sec",
|
"sec":"sec",
|
||||||
"min":"min"
|
"min":"min",
|
||||||
|
"Please provide us some personal data":"Please provide us some personal data",
|
||||||
|
"To lift your experience using the app":"To lift your experience using the app"
|
||||||
}
|
}
|
@ -333,5 +333,7 @@
|
|||||||
"Step": "Lépés:",
|
"Step": "Lépés:",
|
||||||
"Or type the time manually:":"Vagy jelöld ki az időt kézzel",
|
"Or type the time manually:":"Vagy jelöld ki az időt kézzel",
|
||||||
"sec":"mp",
|
"sec":"mp",
|
||||||
"min":"perc"
|
"min":"perc",
|
||||||
|
"Please provide us some personal data":"Kérlek adj meg néhány adatot,",
|
||||||
|
"To lift your experience using the app":"Hogy emelni tudjuk az app élményét"
|
||||||
}
|
}
|
@ -21,6 +21,6 @@
|
|||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.0</string>
|
<string>1.0</string>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>12.0</string>
|
<string>10.0</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Uncomment this line to define a global platform for your project
|
# Uncomment this line to define a global platform for your project
|
||||||
platform :ios, '11.0'
|
platform :ios, '10.0'
|
||||||
|
|
||||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
|
@ -312,6 +312,6 @@ SPEC CHECKSUMS:
|
|||||||
wakelock: bfc7955c418d0db797614075aabbc58a39ab5107
|
wakelock: bfc7955c418d0db797614075aabbc58a39ab5107
|
||||||
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
|
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
|
||||||
|
|
||||||
PODFILE CHECKSUM: ac11fc852a681d8d7d22e344055d0c36b734cfc2
|
PODFILE CHECKSUM: ffdd26129895d158b3c89ac44e19a7e054386b90
|
||||||
|
|
||||||
COCOAPODS: 1.10.0
|
COCOAPODS: 1.10.0
|
||||||
|
@ -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 = (
|
||||||
|
@ -94,11 +94,12 @@ class CustomerChangeBloc extends Bloc<CustomerChangeEvent, CustomerChangeState>
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool validation() {
|
bool validation() {
|
||||||
print("f " + customerRepository.customer.firstname);
|
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) {
|
||||||
|
@ -7,6 +7,7 @@ import 'package:aitrainer_app/repository/user_repository.dart';
|
|||||||
import 'package:aitrainer_app/service/exercise_tree_service.dart';
|
import 'package:aitrainer_app/service/exercise_tree_service.dart';
|
||||||
import 'package:aitrainer_app/service/exercisetype_service.dart';
|
import 'package:aitrainer_app/service/exercisetype_service.dart';
|
||||||
import 'package:aitrainer_app/util/common.dart';
|
import 'package:aitrainer_app/util/common.dart';
|
||||||
|
import 'package:aitrainer_app/util/enums.dart';
|
||||||
import 'package:aitrainer_app/util/trans.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';
|
||||||
@ -51,9 +52,11 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
|||||||
await userRepository.getUser();
|
await userRepository.getUser();
|
||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
Flurry.logEvent("Login");
|
Flurry.logEvent("Login");
|
||||||
|
Cache().setLoginType(LoginType.email);
|
||||||
yield LoginSuccess();
|
yield LoginSuccess();
|
||||||
} else if (event is LoginFB) {
|
} else if (event is LoginFB) {
|
||||||
yield LoginLoading();
|
yield LoginLoading();
|
||||||
|
Cache().setLoginType(LoginType.fb);
|
||||||
await userRepository.getUserByFB();
|
await userRepository.getUserByFB();
|
||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
Flurry.logEvent("Login");
|
Flurry.logEvent("Login");
|
||||||
@ -61,6 +64,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
|||||||
yield LoginSuccess();
|
yield LoginSuccess();
|
||||||
} else if (event is LoginGoogle) {
|
} else if (event is LoginGoogle) {
|
||||||
yield LoginLoading();
|
yield LoginLoading();
|
||||||
|
Cache().setLoginType(LoginType.google);
|
||||||
await userRepository.getUserByGoogle();
|
await userRepository.getUserByGoogle();
|
||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
Flurry.logEvent("Login");
|
Flurry.logEvent("Login");
|
||||||
@ -68,6 +72,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
|||||||
yield LoginSuccess();
|
yield LoginSuccess();
|
||||||
} else if (event is LoginApple) {
|
} else if (event is LoginApple) {
|
||||||
yield LoginLoading();
|
yield LoginLoading();
|
||||||
|
Cache().setLoginType(LoginType.apple);
|
||||||
await userRepository.getUserByApple();
|
await userRepository.getUserByApple();
|
||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
Flurry.logEvent("Login");
|
Flurry.logEvent("Login");
|
||||||
@ -83,7 +88,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
|||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
await saveCustomer();
|
await saveCustomer();
|
||||||
Flurry.logEvent("Registration");
|
Flurry.logEvent("Registration");
|
||||||
|
Cache().setLoginType(LoginType.email);
|
||||||
yield LoginSuccess();
|
yield LoginSuccess();
|
||||||
} else if (event is RegistrationFB) {
|
} else if (event is RegistrationFB) {
|
||||||
yield LoginLoading();
|
yield LoginLoading();
|
||||||
@ -91,6 +96,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
|||||||
yield LoginError();
|
yield LoginError();
|
||||||
throw Exception("Please accept our data policy");
|
throw Exception("Please accept our data policy");
|
||||||
}
|
}
|
||||||
|
Cache().setLoginType(LoginType.fb);
|
||||||
await userRepository.addUserFB();
|
await userRepository.addUserFB();
|
||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
await saveCustomer();
|
await saveCustomer();
|
||||||
@ -103,6 +109,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
|||||||
yield LoginError();
|
yield LoginError();
|
||||||
throw Exception("Please accept our data policy");
|
throw Exception("Please accept our data policy");
|
||||||
}
|
}
|
||||||
|
Cache().setLoginType(LoginType.google);
|
||||||
await userRepository.addUserGoogle();
|
await userRepository.addUserGoogle();
|
||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
await saveCustomer();
|
await saveCustomer();
|
||||||
@ -115,6 +122,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
|||||||
yield LoginError();
|
yield LoginError();
|
||||||
throw Exception("Please accept our data policy");
|
throw Exception("Please accept our data policy");
|
||||||
}
|
}
|
||||||
|
Cache().setLoginType(LoginType.apple);
|
||||||
await userRepository.addUserApple();
|
await userRepository.addUserApple();
|
||||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||||
await saveCustomer();
|
await saveCustomer();
|
||||||
|
@ -19,6 +19,7 @@ import 'package:aitrainer_app/service/exercise_tree_service.dart';
|
|||||||
import 'package:aitrainer_app/service/exercisetype_service.dart';
|
import 'package:aitrainer_app/service/exercisetype_service.dart';
|
||||||
import 'package:aitrainer_app/service/firebase_api.dart';
|
import 'package:aitrainer_app/service/firebase_api.dart';
|
||||||
import 'package:aitrainer_app/service/logging.dart';
|
import 'package:aitrainer_app/service/logging.dart';
|
||||||
|
import 'package:aitrainer_app/util/enums.dart';
|
||||||
import 'package:aitrainer_app/util/env.dart';
|
import 'package:aitrainer_app/util/env.dart';
|
||||||
import 'package:flurry/flurry.dart';
|
import 'package:flurry/flurry.dart';
|
||||||
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
|
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
|
||||||
@ -63,6 +64,7 @@ class Cache with Logging {
|
|||||||
static final String langKey = 'lang';
|
static final String langKey = 'lang';
|
||||||
static final String serverKey = 'live';
|
static final String serverKey = 'live';
|
||||||
static final String hardwareKey = 'hardware';
|
static final String hardwareKey = 'hardware';
|
||||||
|
static final String loginTypeKey = 'login_type';
|
||||||
|
|
||||||
static String baseUrl = 'http://aitrainer.info:8888/api/';
|
static String baseUrl = 'http://aitrainer.info:8888/api/';
|
||||||
static final String mediaUrl = 'https://aitrainer.info:4343/media/';
|
static final String mediaUrl = 'https://aitrainer.info:4343/media/';
|
||||||
@ -73,6 +75,7 @@ class Cache with Logging {
|
|||||||
AccessToken accessTokenFacebook;
|
AccessToken accessTokenFacebook;
|
||||||
Customer userLoggedIn;
|
Customer userLoggedIn;
|
||||||
String firebaseUid;
|
String firebaseUid;
|
||||||
|
LoginType loginType;
|
||||||
|
|
||||||
bool hasPurchased = false;
|
bool hasPurchased = false;
|
||||||
|
|
||||||
@ -184,6 +187,24 @@ class Cache with Logging {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> setLoginTypeFromPrefs() async {
|
||||||
|
Future<SharedPreferences> prefs = SharedPreferences.getInstance();
|
||||||
|
SharedPreferences sharedPreferences = await prefs;
|
||||||
|
final String loginType = sharedPreferences.getString(Cache.loginTypeKey);
|
||||||
|
LoginType type = LoginType.email;
|
||||||
|
if (loginType == LoginType.apple.toString()) {
|
||||||
|
type = LoginType.apple;
|
||||||
|
} else if (loginType == LoginType.google.toString()) {
|
||||||
|
type = LoginType.google;
|
||||||
|
} else if (loginType == LoginType.fb.toString()) {
|
||||||
|
type = LoginType.fb;
|
||||||
|
} else if (loginType == LoginType.email.toString()) {
|
||||||
|
type = LoginType.email;
|
||||||
|
}
|
||||||
|
print("LoginType: " + loginType == null ? "NULL" : loginType);
|
||||||
|
Cache().setLoginType(type);
|
||||||
|
}
|
||||||
|
|
||||||
static String getToken(SharedPreferences prefs) {
|
static String getToken(SharedPreferences prefs) {
|
||||||
return prefs.getString(authTokenKey);
|
return prefs.getString(authTokenKey);
|
||||||
}
|
}
|
||||||
@ -201,6 +222,8 @@ class Cache with Logging {
|
|||||||
|
|
||||||
userLoggedIn = customer;
|
userLoggedIn = customer;
|
||||||
final String uid = Cache().firebaseUid;
|
final String uid = Cache().firebaseUid;
|
||||||
|
SharedPreferences sharedPreferences = await prefs;
|
||||||
|
sharedPreferences.setString(Cache.loginTypeKey, Cache().getLoginType().toString());
|
||||||
await setPreferences(prefs, SharePrefsChange.registration, customer.customerId, uid);
|
await setPreferences(prefs, SharePrefsChange.registration, customer.customerId, uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,16 +231,22 @@ class Cache with Logging {
|
|||||||
Future<SharedPreferences> prefs = SharedPreferences.getInstance();
|
Future<SharedPreferences> prefs = SharedPreferences.getInstance();
|
||||||
|
|
||||||
userLoggedIn = customer;
|
userLoggedIn = customer;
|
||||||
|
SharedPreferences sharedPreferences = await prefs;
|
||||||
|
sharedPreferences.setString(Cache.loginTypeKey, Cache().getLoginType().toString());
|
||||||
await setPreferences(prefs, SharePrefsChange.login, customer.customerId, Cache().firebaseUid);
|
await setPreferences(prefs, SharePrefsChange.login, customer.customerId, Cache().firebaseUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
afterFirebaseLogin() async {
|
afterFirebaseLogin() async {
|
||||||
Future<SharedPreferences> prefs = SharedPreferences.getInstance();
|
Future<SharedPreferences> prefs = SharedPreferences.getInstance();
|
||||||
|
SharedPreferences sharedPreferences = await prefs;
|
||||||
|
sharedPreferences.setString(Cache.loginTypeKey, Cache().getLoginType().toString());
|
||||||
await setPreferences(prefs, SharePrefsChange.login, userLoggedIn.customerId, Cache().firebaseUid);
|
await setPreferences(prefs, SharePrefsChange.login, userLoggedIn.customerId, Cache().firebaseUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
afterFacebookLogin() async {
|
afterFacebookLogin() async {
|
||||||
Future<SharedPreferences> prefs = SharedPreferences.getInstance();
|
Future<SharedPreferences> prefs = SharedPreferences.getInstance();
|
||||||
|
SharedPreferences sharedPreferences = await prefs;
|
||||||
|
sharedPreferences.setString(Cache.loginTypeKey, Cache().getLoginType().toString());
|
||||||
await setPreferences(prefs, SharePrefsChange.login, userLoggedIn.customerId, Cache().firebaseUid);
|
await setPreferences(prefs, SharePrefsChange.login, userLoggedIn.customerId, Cache().firebaseUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +421,7 @@ class Cache with Logging {
|
|||||||
_badges = LinkedHashMap();
|
_badges = LinkedHashMap();
|
||||||
customerRepository.setCustomer(userLoggedIn);
|
customerRepository.setCustomer(userLoggedIn);
|
||||||
if (this.userLoggedIn != null) {
|
if (this.userLoggedIn != null) {
|
||||||
if (this.userLoggedIn.firstname == null || userLoggedIn.firstname.length == 0) {
|
if (this.userLoggedIn.birthYear == null || this.userLoggedIn.birthYear == 0) {
|
||||||
setBadge("personalData", true);
|
setBadge("personalData", true);
|
||||||
setBadge("account", true);
|
setBadge("account", true);
|
||||||
}
|
}
|
||||||
@ -457,9 +486,13 @@ class Cache with Logging {
|
|||||||
await customerRepository.getProductTests();
|
await customerRepository.getProductTests();
|
||||||
|
|
||||||
//this.hasPurchased = this._purchases.isNotEmpty;
|
//this.hasPurchased = this._purchases.isNotEmpty;
|
||||||
|
await setLoginTypeFromPrefs();
|
||||||
Cache().startPage = "home";
|
Cache().startPage = "home";
|
||||||
}
|
}
|
||||||
|
|
||||||
AccessToken get getAccessTokenFacebook => accessTokenFacebook;
|
AccessToken get getAccessTokenFacebook => accessTokenFacebook;
|
||||||
set setAccessTokenFacebook(AccessToken accessTokenFacebook) => this.accessTokenFacebook = accessTokenFacebook;
|
set setAccessTokenFacebook(AccessToken accessTokenFacebook) => this.accessTokenFacebook = accessTokenFacebook;
|
||||||
|
|
||||||
|
LoginType getLoginType() => loginType;
|
||||||
|
void setLoginType(LoginType type) => this.loginType = type;
|
||||||
}
|
}
|
||||||
|
6
lib/util/enums.dart
Normal file
6
lib/util/enums.dart
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
enum LoginType { email, fb, google, apple }
|
||||||
|
|
||||||
|
extension LoginTypeExt on LoginType {
|
||||||
|
bool equalsTo(LoginType type) => this.toString() == type.toString();
|
||||||
|
bool equalsStringTo(String type) => this.toString() == type;
|
||||||
|
}
|
@ -37,18 +37,32 @@ class AccountPage extends StatelessWidget with Trans {
|
|||||||
}, builder: (context, state) {
|
}, builder: (context, state) {
|
||||||
if (state is AccountInitial) {
|
if (state is AccountInitial) {
|
||||||
String customerName = accountBloc.customerRepository.firstName + " " + accountBloc.customerRepository.name;
|
String customerName = accountBloc.customerRepository.firstName + " " + accountBloc.customerRepository.name;
|
||||||
|
if (customerName.length < 3) {
|
||||||
|
customerName = t("Personal data");
|
||||||
|
}
|
||||||
|
|
||||||
return accountWidget(context, customerName, accountBloc);
|
return accountWidget(context, customerName, accountBloc);
|
||||||
} else if (state is AccountLoggedIn) {
|
} else if (state is AccountLoggedIn) {
|
||||||
String customerName = accountBloc.customerRepository.firstName + " " + accountBloc.customerRepository.name;
|
String customerName = accountBloc.customerRepository.firstName + " " + accountBloc.customerRepository.name;
|
||||||
|
|
||||||
|
if (customerName.length < 3) {
|
||||||
|
customerName = t("Personal data");
|
||||||
|
}
|
||||||
return accountWidget(context, customerName, accountBloc);
|
return accountWidget(context, customerName, accountBloc);
|
||||||
} else if (state is AccountLoggedOut) {
|
} else if (state is AccountLoggedOut) {
|
||||||
String customerName = "";
|
String customerName = "";
|
||||||
|
if (customerName.length < 3) {
|
||||||
|
customerName = t("Personal data");
|
||||||
|
}
|
||||||
return accountWidget(context, customerName, accountBloc);
|
return accountWidget(context, customerName, accountBloc);
|
||||||
} else if (state is AccountReady) {
|
} else if (state is AccountReady) {
|
||||||
String customerName = accountBloc.customerRepository.firstName + " " + accountBloc.customerRepository.name;
|
String customerName = accountBloc.customerRepository.firstName + " " + accountBloc.customerRepository.name;
|
||||||
|
if (customerName.length < 3) {
|
||||||
|
customerName = t("Personal data");
|
||||||
|
}
|
||||||
return accountWidget(context, customerName, accountBloc);
|
return accountWidget(context, customerName, accountBloc);
|
||||||
} else {
|
} else {
|
||||||
return accountWidget(context, "", accountBloc);
|
return accountWidget(context, t("Personal data"), accountBloc);
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
import 'package:aitrainer_app/bloc/account/account_bloc.dart';
|
import 'package:aitrainer_app/bloc/account/account_bloc.dart';
|
||||||
import 'package:aitrainer_app/bloc/customer_change/customer_change_bloc.dart';
|
import 'package:aitrainer_app/bloc/customer_change/customer_change_bloc.dart';
|
||||||
import 'package:aitrainer_app/library/numberpicker.dart';
|
import 'package:aitrainer_app/library/numberpicker.dart';
|
||||||
|
import 'package:aitrainer_app/model/cache.dart';
|
||||||
|
import 'package:aitrainer_app/util/enums.dart';
|
||||||
import 'package:aitrainer_app/util/trans.dart';
|
import 'package:aitrainer_app/util/trans.dart';
|
||||||
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
import 'package:aitrainer_app/widgets/app_bar_min.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:modal_progress_hud/modal_progress_hud.dart';
|
import 'package:modal_progress_hud/modal_progress_hud.dart';
|
||||||
|
|
||||||
import 'package:toggle_switch/toggle_switch.dart';
|
import 'package:toggle_switch/toggle_switch.dart';
|
||||||
@ -80,103 +83,118 @@ class CustomerModifyPage extends StatelessWidget with Trans {
|
|||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
TextFormField(
|
Text(t("Please provide us some personal data"),
|
||||||
key: LibraryKeys.loginEmailField,
|
style: GoogleFonts.inter(color: Colors.indigo, fontSize: 16), textAlign: TextAlign.center),
|
||||||
decoration: InputDecoration(
|
Text(t("To lift your experience using the app"),
|
||||||
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
style: GoogleFonts.inter(color: Colors.orange[700], fontSize: 16), textAlign: TextAlign.center),
|
||||||
labelText: t('Email'),
|
|
||||||
fillColor: Colors.white24,
|
|
||||||
filled: true,
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
gapPadding: 4.0,
|
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
|
||||||
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
initialValue: customerBloc.customerRepository.customer.email,
|
|
||||||
autovalidateMode: AutovalidateMode.always,
|
|
||||||
validator: (val) {
|
|
||||||
return customerBloc.emailValidation(val);
|
|
||||||
},
|
|
||||||
keyboardType: TextInputType.emailAddress,
|
|
||||||
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
|
||||||
),
|
|
||||||
Divider(
|
Divider(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
),
|
),
|
||||||
TextFormField(
|
Cache().getLoginType() == LoginType.email
|
||||||
key: LibraryKeys.loginPasswordField,
|
? TextFormField(
|
||||||
obscureText: true,
|
key: LibraryKeys.loginEmailField,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
labelStyle: TextStyle(fontSize: 14),
|
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
||||||
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
labelText: t('Email'),
|
||||||
suffixIcon: IconButton(
|
fillColor: Colors.white24,
|
||||||
onPressed: () => {customerBloc.add(CustomerChangePasswordObscure())},
|
filled: true,
|
||||||
icon: Icon(Icons.remove_red_eye),
|
border: OutlineInputBorder(
|
||||||
),
|
gapPadding: 4.0,
|
||||||
labelText: t('Password (Leave empty if no change)'),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
fillColor: Colors.white24,
|
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
||||||
filled: true,
|
),
|
||||||
border: OutlineInputBorder(
|
),
|
||||||
gapPadding: 1.0,
|
initialValue: customerBloc.customerRepository.customer.email,
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
autovalidateMode: AutovalidateMode.always,
|
||||||
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
validator: (val) {
|
||||||
),
|
return customerBloc.emailValidation(val);
|
||||||
),
|
},
|
||||||
initialValue: customerBloc.customerRepository.customer.password,
|
keyboardType: TextInputType.emailAddress,
|
||||||
autovalidateMode: AutovalidateMode.always,
|
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
||||||
validator: (val) {
|
)
|
||||||
return customerBloc.passwordValidation(val);
|
: Offstage(),
|
||||||
},
|
|
||||||
keyboardType: TextInputType.visiblePassword,
|
|
||||||
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
|
||||||
),
|
|
||||||
Divider(
|
Divider(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
),
|
),
|
||||||
TextFormField(
|
Cache().getLoginType() == LoginType.email
|
||||||
decoration: InputDecoration(
|
? TextFormField(
|
||||||
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
key: LibraryKeys.loginPasswordField,
|
||||||
labelText: t('Name'),
|
obscureText: true,
|
||||||
fillColor: Colors.white24,
|
decoration: InputDecoration(
|
||||||
filled: true,
|
labelStyle: TextStyle(fontSize: 14),
|
||||||
border: OutlineInputBorder(
|
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
||||||
gapPadding: 1.0,
|
suffixIcon: IconButton(
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
onPressed: () => {customerBloc.add(CustomerChangePasswordObscure())},
|
||||||
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
icon: Icon(Icons.remove_red_eye),
|
||||||
),
|
),
|
||||||
),
|
labelText: t('Password (Leave empty if no change)'),
|
||||||
initialValue: customerBloc.customerRepository.customer.name,
|
fillColor: Colors.white24,
|
||||||
autovalidateMode: AutovalidateMode.always,
|
filled: true,
|
||||||
validator: (val) {
|
border: OutlineInputBorder(
|
||||||
return customerBloc.nameValidation(val);
|
gapPadding: 1.0,
|
||||||
},
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
keyboardType: TextInputType.name,
|
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
||||||
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
),
|
||||||
onChanged: (value) => {customerBloc.add(CustomerNameChange(name: value))}),
|
),
|
||||||
|
initialValue: customerBloc.customerRepository.customer.password,
|
||||||
|
autovalidateMode: AutovalidateMode.always,
|
||||||
|
validator: (val) {
|
||||||
|
return customerBloc.passwordValidation(val);
|
||||||
|
},
|
||||||
|
keyboardType: TextInputType.visiblePassword,
|
||||||
|
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
||||||
|
)
|
||||||
|
: Offstage(),
|
||||||
Divider(
|
Divider(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
),
|
),
|
||||||
TextFormField(
|
Cache().getLoginType() != LoginType.apple
|
||||||
decoration: InputDecoration(
|
? TextFormField(
|
||||||
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
decoration: InputDecoration(
|
||||||
labelText: t('First Name'),
|
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
||||||
fillColor: Colors.white24,
|
labelText: t('Name'),
|
||||||
filled: true,
|
fillColor: Colors.white24,
|
||||||
border: OutlineInputBorder(
|
filled: true,
|
||||||
gapPadding: 2.0,
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12.0),
|
gapPadding: 1.0,
|
||||||
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
),
|
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
||||||
),
|
),
|
||||||
initialValue: customerBloc.customerRepository.customer.firstname,
|
),
|
||||||
autovalidateMode: AutovalidateMode.always,
|
initialValue: customerBloc.customerRepository.customer.name,
|
||||||
validator: (val) {
|
autovalidateMode: AutovalidateMode.always,
|
||||||
return customerBloc.nameValidation(val);
|
validator: (val) {
|
||||||
},
|
return customerBloc.nameValidation(val);
|
||||||
keyboardType: TextInputType.name,
|
},
|
||||||
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
keyboardType: TextInputType.name,
|
||||||
onChanged: (value) => {customerBloc.add(CustomerFirstNameChange(firstName: value))}),
|
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
||||||
|
onChanged: (value) => {customerBloc.add(CustomerNameChange(name: value))})
|
||||||
|
: Offstage(),
|
||||||
|
Divider(
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
|
Cache().getLoginType() != LoginType.apple
|
||||||
|
? TextFormField(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
contentPadding: EdgeInsets.only(left: 15, top: 15, bottom: 15),
|
||||||
|
labelText: t('First Name'),
|
||||||
|
fillColor: Colors.white24,
|
||||||
|
filled: true,
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
gapPadding: 2.0,
|
||||||
|
borderRadius: BorderRadius.circular(12.0),
|
||||||
|
borderSide: BorderSide(color: Colors.green[50], width: 0.4),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
initialValue: customerBloc.customerRepository.customer.firstname,
|
||||||
|
autovalidateMode: AutovalidateMode.always,
|
||||||
|
validator: (val) {
|
||||||
|
return customerBloc.nameValidation(val);
|
||||||
|
},
|
||||||
|
keyboardType: TextInputType.name,
|
||||||
|
style: new TextStyle(fontSize: 16, color: Colors.indigo),
|
||||||
|
onChanged: (value) => {customerBloc.add(CustomerFirstNameChange(firstName: value))})
|
||||||
|
: Offstage(),
|
||||||
Divider(
|
Divider(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
),
|
),
|
||||||
|
@ -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.5+52
|
version: 1.1.5+54
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.7.0 <3.0.0"
|
sdk: ">=2.7.0 <3.0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user