Create account
This commit is contained in:
parent
4bc6f65d11
commit
05e73c5c38
|
|
@ -15,11 +15,16 @@ class AuthRepository {
|
|||
|
||||
final WebClient webClient;
|
||||
|
||||
Future<LoginResponseData> signUp(
|
||||
{String email,
|
||||
String password,
|
||||
String platform,}) async {
|
||||
Future<LoginResponseData> signUp({
|
||||
String firstName,
|
||||
String lastName,
|
||||
String email,
|
||||
String password,
|
||||
String platform,
|
||||
}) async {
|
||||
final credentials = {
|
||||
'first_name': firstName,
|
||||
'last_name': lastName,
|
||||
'token_name': 'invoice-ninja-$platform-app',
|
||||
'api_secret': Config.API_SECRET,
|
||||
'email': email,
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ Middleware<AppState> _createSignUpRequest(AuthRepository repository) {
|
|||
email: action.email,
|
||||
password: action.password,
|
||||
platform: action.platform,
|
||||
firstName: action.firstName,
|
||||
lastName: action.lastName,
|
||||
)
|
||||
.then((data) {
|
||||
_saveAuthLocal(
|
||||
|
|
|
|||
|
|
@ -202,11 +202,19 @@ class _LoginState extends State<LoginView> {
|
|||
DecoratedFormField(
|
||||
label: localization.firstName,
|
||||
controller: _firstNameController,
|
||||
autovalidate: _autoValidate,
|
||||
validator: (val) => val.isEmpty || val.trim().isEmpty
|
||||
? localization.pleaseEnterAFirstName
|
||||
: null,
|
||||
),
|
||||
if (_createAccount)
|
||||
DecoratedFormField(
|
||||
label: localization.lastName,
|
||||
controller: _lastNameController,
|
||||
autovalidate: _autoValidate,
|
||||
validator: (val) => val.isEmpty || val.trim().isEmpty
|
||||
? localization.pleaseEnterALastName
|
||||
: null,
|
||||
),
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ abstract class LocaleCodeAware {
|
|||
mixin LocalizationsProvider on LocaleCodeAware {
|
||||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
'please_enter_a_first_name': 'Please enter a first name',
|
||||
'please_enter_a_last_name': 'Please enter a last name',
|
||||
'please_agree_to_terms_and_privacy' :
|
||||
'Please agree to the terms of service and privacy policy to create an account.',
|
||||
'i_agree_to_the': 'I agree to the',
|
||||
|
|
@ -13148,6 +13150,12 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
String get pleaseEnterAProductKey =>
|
||||
_localizedValues[localeCode]['please_enter_a_product_key'];
|
||||
|
||||
String get pleaseEnterAFirstName =>
|
||||
_localizedValues[localeCode]['please_enter_a_last_name'];
|
||||
|
||||
String get pleaseEnterALastName =>
|
||||
_localizedValues[localeCode]['please_enter_a_first_name'];
|
||||
|
||||
String get ascending => _localizedValues[localeCode]['ascending'];
|
||||
|
||||
String get descending => _localizedValues[localeCode]['descending'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue