Skip to content

Commit 2b4975e

Browse files
authored
Feature/login form managament (#112)
* Login form * add espanish translation * fix suggestions
1 parent 28e4a38 commit 2b4975e

File tree

26 files changed

+566
-213
lines changed

26 files changed

+566
-213
lines changed

app/lib/presentation/navigation/routers.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:app/main/init.dart';
2-
import 'package:app/presentation/ui/pages/home/home_page.dart';
3-
import 'package:app/presentation/ui/pages/login/login_page.dart';
4-
import 'package:app/presentation/ui/pages/sign_up/sign_up_page.dart';
2+
import 'package:app/presentation/ui/pages/main/home/home_page.dart';
3+
import 'package:app/presentation/ui/pages/auth/login/login_page.dart';
4+
import 'package:app/presentation/ui/pages/auth/sign_up/sign_up_page.dart';
55
import 'package:app/presentation/ui/pages/splash/splash_page.dart';
66
import 'package:common/core/resource.dart';
77
import 'package:domain/bloc/auth/auth_cubit.dart';

app/lib/presentation/resources/dim.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,18 @@ part of 'resources.dart';
55
class Dimen {
66
static const primaryButtonHeight = 48.0;
77
static const loadingSpinnerSize = 32.0;
8+
static const loadingSpinnerSizeS = 16.0;
9+
10+
static const double loginFormMaxWidth = 400.0;
11+
12+
static const spacingXxs = 2.0;
13+
static const spacingXs = 4.0;
14+
static const spacingS = 8.0;
15+
static const spacingM = 16.0;
16+
static const spacingL = 24.0;
17+
static const spacingXl = 32.0;
18+
static const spacingXxl = 40.0;
19+
static const spacingXxxl = 48.0;
20+
21+
static const double buttonHeightM = 48.0;
822
}

app/lib/presentation/resources/locale/generated/intl/messages_all.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ MessageLookupByLibrary? _findExact(String localeName) {
3939
/// User programs should call this before using [localeName] for messages.
4040
Future<bool> initializeMessages(String localeName) {
4141
var availableLocale = Intl.verifiedLocale(
42-
localeName, (locale) => _deferredLibraries[locale] != null,
43-
onFailure: (_) => null);
42+
localeName,
43+
(locale) => _deferredLibraries[locale] != null,
44+
onFailure: (_) => null,
45+
);
4446
if (availableLocale == null) {
4547
return new SynchronousFuture(false);
4648
}
@@ -60,8 +62,11 @@ bool _messagesExistFor(String locale) {
6062
}
6163

6264
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
63-
var actualLocale =
64-
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
65+
var actualLocale = Intl.verifiedLocale(
66+
locale,
67+
_messagesExistFor,
68+
onFailure: (_) => null,
69+
);
6570
if (actualLocale == null) return null;
6671
return _findExact(actualLocale);
6772
}

app/lib/presentation/resources/locale/generated/intl/messages_en.dart

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,50 @@ class MessageLookup extends MessageLookupByLibrary {
2222

2323
final messages = _notInlinedMessages(_notInlinedMessages);
2424
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
25-
"appName": MessageLookupByLibrary.simpleMessage("Flutter Target"),
26-
"cookiesAcceptCTA": MessageLookupByLibrary.simpleMessage("Accept"),
27-
"cookiesBody": MessageLookupByLibrary.simpleMessage(
28-
"We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services."),
29-
"cookiesTitle":
30-
MessageLookupByLibrary.simpleMessage("This website uses cookies"),
31-
"noConnection": MessageLookupByLibrary.simpleMessage("No connection"),
32-
"pleaseTryAgainLaterWeArenworkingToFixTheIssue":
33-
MessageLookupByLibrary.simpleMessage(
34-
"Please try again later, we are\nworking to fix the issue."),
35-
"retry": MessageLookupByLibrary.simpleMessage("Retry"),
36-
"sorryWeDidntFindAnyProduct": MessageLookupByLibrary.simpleMessage(
37-
"Sorry we didn\'t find any product")
38-
};
25+
"appName": MessageLookupByLibrary.simpleMessage("Flutter Target"),
26+
"cookiesAcceptCTA": MessageLookupByLibrary.simpleMessage("Accept"),
27+
"cookiesBody": MessageLookupByLibrary.simpleMessage(
28+
"We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.",
29+
),
30+
"cookiesTitle": MessageLookupByLibrary.simpleMessage(
31+
"This website uses cookies",
32+
),
33+
"ctaLogin": MessageLookupByLibrary.simpleMessage("Login"),
34+
"errorEmailInvalid": MessageLookupByLibrary.simpleMessage(
35+
"Please enter a valid email address.",
36+
),
37+
"errorEmailRequired": MessageLookupByLibrary.simpleMessage(
38+
"Email is required.",
39+
),
40+
"errorPasswordRequired": MessageLookupByLibrary.simpleMessage(
41+
"Password is required.",
42+
),
43+
"errorPasswordWeak": MessageLookupByLibrary.simpleMessage(
44+
"Password is too weak.",
45+
),
46+
"labelAgreeToTerms": MessageLookupByLibrary.simpleMessage(
47+
"I agree to the Terms and Conditions",
48+
),
49+
"labelEmail": MessageLookupByLibrary.simpleMessage("Email"),
50+
"labelPassword": MessageLookupByLibrary.simpleMessage("Password"),
51+
"loginErrorInvalidCredentials": MessageLookupByLibrary.simpleMessage(
52+
"Invalid email or password.",
53+
),
54+
"noConnection": MessageLookupByLibrary.simpleMessage("No connection"),
55+
"passwordInstructions": MessageLookupByLibrary.simpleMessage(
56+
"Min 8 characters long: 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character.",
57+
),
58+
"pleaseTryAgainLaterWeArenworkingToFixTheIssue":
59+
MessageLookupByLibrary.simpleMessage(
60+
"Please try again later, we are\nworking to fix the issue.",
61+
),
62+
"retry": MessageLookupByLibrary.simpleMessage("Retry"),
63+
"sorryWeDidntFindAnyProduct": MessageLookupByLibrary.simpleMessage(
64+
"Sorry we didn\'t find any product",
65+
),
66+
"titleLogin": MessageLookupByLibrary.simpleMessage("Login"),
67+
"titleLoginSubtitle": MessageLookupByLibrary.simpleMessage(
68+
"Use your email and password to login to your account.",
69+
),
70+
};
3971
}

app/lib/presentation/resources/locale/generated/intl/messages_es.dart

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,50 @@ class MessageLookup extends MessageLookupByLibrary {
2222

2323
final messages = _notInlinedMessages(_notInlinedMessages);
2424
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
25-
"appName": MessageLookupByLibrary.simpleMessage("Flutter Target"),
26-
"cookiesAcceptCTA": MessageLookupByLibrary.simpleMessage("Accept"),
27-
"cookiesBody": MessageLookupByLibrary.simpleMessage(
28-
"We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services."),
29-
"cookiesTitle":
30-
MessageLookupByLibrary.simpleMessage("This website uses cookies"),
31-
"noConnection": MessageLookupByLibrary.simpleMessage("No connection"),
32-
"pleaseTryAgainLaterWeArenworkingToFixTheIssue":
33-
MessageLookupByLibrary.simpleMessage(
34-
"Please try again later, we are\nworking to fix the issue."),
35-
"retry": MessageLookupByLibrary.simpleMessage("Retry"),
36-
"sorryWeDidntFindAnyProduct": MessageLookupByLibrary.simpleMessage(
37-
"Sorry we didn\'t find any product")
38-
};
25+
"appName": MessageLookupByLibrary.simpleMessage("Flutter Target"),
26+
"cookiesAcceptCTA": MessageLookupByLibrary.simpleMessage("Aceptar"),
27+
"cookiesBody": MessageLookupByLibrary.simpleMessage(
28+
"Usamos cookies para personalizar el contenido y los anuncios, ofrecer funciones de redes sociales y analizar nuestro tráfico. También compartimos información sobre el uso de nuestro sitio con nuestros socios de redes sociales, publicidad y análisis, quienes pueden combinarla con otra información que les hayas proporcionado o que hayan recopilado a partir del uso de sus servicios.",
29+
),
30+
"cookiesTitle": MessageLookupByLibrary.simpleMessage(
31+
"Este sitio web utiliza cookies",
32+
),
33+
"ctaLogin": MessageLookupByLibrary.simpleMessage("Iniciar sesión"),
34+
"errorEmailInvalid": MessageLookupByLibrary.simpleMessage(
35+
"Por favor ingresa una dirección de correo válida.",
36+
),
37+
"errorEmailRequired": MessageLookupByLibrary.simpleMessage(
38+
"El correo electrónico es obligatorio.",
39+
),
40+
"errorPasswordRequired": MessageLookupByLibrary.simpleMessage(
41+
"La contraseña es obligatoria.",
42+
),
43+
"errorPasswordWeak": MessageLookupByLibrary.simpleMessage(
44+
"La contraseña es demasiado débil.",
45+
),
46+
"labelAgreeToTerms": MessageLookupByLibrary.simpleMessage(
47+
"Acepto los Términos y Condiciones",
48+
),
49+
"labelEmail": MessageLookupByLibrary.simpleMessage("Correo electrónico"),
50+
"labelPassword": MessageLookupByLibrary.simpleMessage("Contraseña"),
51+
"loginErrorInvalidCredentials": MessageLookupByLibrary.simpleMessage(
52+
"Correo o contraseña inválidos.",
53+
),
54+
"noConnection": MessageLookupByLibrary.simpleMessage("Sin conexión"),
55+
"passwordInstructions": MessageLookupByLibrary.simpleMessage(
56+
"Mínimo 8 caracteres: 1 mayúscula, 1 minúscula, 1 número y 1 carácter especial.",
57+
),
58+
"pleaseTryAgainLaterWeArenworkingToFixTheIssue":
59+
MessageLookupByLibrary.simpleMessage(
60+
"Por favor, inténtalo más tarde,\nestamos trabajando para resolver el problema.",
61+
),
62+
"retry": MessageLookupByLibrary.simpleMessage("Reintentar"),
63+
"sorryWeDidntFindAnyProduct": MessageLookupByLibrary.simpleMessage(
64+
"Lo sentimos, no hemos encontrado ningún producto",
65+
),
66+
"titleLogin": MessageLookupByLibrary.simpleMessage("Iniciar sesión"),
67+
"titleLoginSubtitle": MessageLookupByLibrary.simpleMessage(
68+
"Usa tu correo y contraseña para iniciar sesión en tu cuenta.",
69+
),
70+
};
3971
}

app/lib/presentation/resources/locale/generated/l10n.dart

Lines changed: 115 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)