merge develop into components
This commit is contained in:
@@ -19,7 +19,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>{
|
||||
bool passwordVisible = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
bool passwordVisible = true;
|
||||
@@ -30,6 +30,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>{
|
||||
children: [
|
||||
Icon(Icons.check, color: theme.getColorFor(ThemeCode.buttonPrimary), size: 50),
|
||||
Text(
|
||||
// context.translate(I18n.example)
|
||||
"¡Te damos la bienvenida!",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
|
||||
@@ -59,7 +60,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>{
|
||||
child: CustomTextButton(
|
||||
text: "¿Has olvidado la contraseña?",
|
||||
onPressed: () =>
|
||||
widget.navigationContract.pushTo('/recover_password'),
|
||||
widget.navigationContract.pushTo(AppRoutes.recoverPassword),
|
||||
size: 16,
|
||||
)),
|
||||
],
|
||||
@@ -67,7 +68,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen>{
|
||||
],
|
||||
),
|
||||
PrimaryButton(
|
||||
onPressed: () => widget.navigationContract.goTo('/main/home'),
|
||||
onPressed: () => widget.navigationContract.goTo(AppRoutes.dashboardHome),
|
||||
text: "Iniciar sesión",
|
||||
color: theme.getColorFor(ThemeCode.buttonPrimary)
|
||||
),
|
||||
|
||||
@@ -78,7 +78,7 @@ class PhoneCodeScreen extends ConsumerWidget {
|
||||
spacing: 24,
|
||||
children: [
|
||||
PrimaryButton(
|
||||
onPressed: () => {navigationContract.pushTo('/login')},
|
||||
onPressed: () => {navigationContract.pushTo(AppRoutes.login)},
|
||||
text: "Entrar",
|
||||
color: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
),
|
||||
|
||||
@@ -4,68 +4,114 @@ import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
|
||||
class WelcomeScreen extends ConsumerWidget {
|
||||
class WelcomeScreen extends ConsumerStatefulWidget {
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
const WelcomeScreen({super.key, required this.navigationContract});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
ConsumerState<ConsumerStatefulWidget> createState() => WelcomeScreenState(navigationContract: navigationContract);
|
||||
|
||||
}
|
||||
|
||||
class WelcomeScreenState extends ConsumerState{
|
||||
late int currentStep;
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
WelcomeScreenState({required this.navigationContract});
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
currentStep = 0;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Spacer(),
|
||||
Expanded(
|
||||
child: CarouselView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemExtent: double.infinity,
|
||||
itemSnapping: true,
|
||||
shrinkExtent: 400,
|
||||
children: generateSteps(),
|
||||
),
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => navigationContract.goTo(AppRoutes.linkPhone),
|
||||
child: const Text('Continuar'),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
body: Container(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: Center(
|
||||
child: Column(
|
||||
spacing: 48,
|
||||
children: [
|
||||
Spacer(),
|
||||
generateSteps()[currentStep],
|
||||
Column(
|
||||
spacing: 24,
|
||||
children: [
|
||||
StepIndicator(
|
||||
max: 3,
|
||||
current: currentStep+1,
|
||||
color: theme.getColorFor(ThemeCode.buttonSecondary)
|
||||
),
|
||||
generateButtons(theme, 3, currentStep+1)
|
||||
]
|
||||
),
|
||||
Spacer()
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void jumpToNext(BuildContext context) {
|
||||
// Navigator.pushReplacement(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (_) => LinkPhoneScreen()),
|
||||
// );
|
||||
return;
|
||||
Widget generateButtons(ThemePort theme, int max, int step){
|
||||
if (step==max) {
|
||||
return PrimaryButton(
|
||||
onPressed: () => navigationContract.goTo(AppRoutes.linkPhone),
|
||||
text: "Continuar",
|
||||
color: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
width: 324,
|
||||
);
|
||||
} else {
|
||||
return Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
PrimaryButton(
|
||||
onPressed: ()=>setState(() {
|
||||
currentStep++;
|
||||
}),
|
||||
text: "Siguiente",
|
||||
color: theme.getColorFor(ThemeCode.buttonSecondary),
|
||||
width: 324,
|
||||
),
|
||||
CustomTextButton(
|
||||
onPressed: ()=>navigationContract.goTo(AppRoutes.linkPhone),
|
||||
text: "Omitir",
|
||||
size: 18,
|
||||
weight: FontWeight.w500,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
List<Widget> generateSteps() {
|
||||
return [
|
||||
Column(
|
||||
spacing: 48,
|
||||
children: [
|
||||
SvgPicture.asset("assets/images/ui/bienvenida_paso1.svg"),
|
||||
Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
const Text(
|
||||
"Aprende a gestionar su dinero",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
),
|
||||
const Text(
|
||||
"Tu peque crea hábitos y se divierte mientras lo hace",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
spacing: 48,
|
||||
children: [
|
||||
SvgPicture.asset("assets/images/ui/bienvenida_paso1.svg"),
|
||||
Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text(
|
||||
"Aprende a gestionar su dinero",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
),
|
||||
Text(
|
||||
"Tu peque crea hábitos y se divierte mientras lo hace",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
),
|
||||
Column(
|
||||
spacing: 48,
|
||||
@@ -74,15 +120,15 @@ class WelcomeScreen extends ConsumerWidget {
|
||||
Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
const Text(
|
||||
"Tranquilidad en cada pago que hace",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
Text(
|
||||
"Tranquilidad en cada pago que hace",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
),
|
||||
const Text(
|
||||
"Supervisa sus gastos, fija límites y acompáñale en cada paso",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
Text(
|
||||
"Supervisa sus gastos, fija límites y acompáñale en cada paso",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
),
|
||||
],
|
||||
)
|
||||
@@ -95,12 +141,12 @@ class WelcomeScreen extends ConsumerWidget {
|
||||
Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
const Text(
|
||||
Text(
|
||||
"Pagos fáciles y seguros, en sus manos",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
),
|
||||
const Text(
|
||||
Text(
|
||||
"Podrá pagar desde su reloj.\n Sin móvil ni efectivo",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
|
||||
@@ -169,7 +169,7 @@ class NewPasswordScreenState extends ConsumerState<NewPasswordScreen> {
|
||||
],
|
||||
),
|
||||
PrimaryButton(
|
||||
onPressed: ()=>{navigationContract.goTo('/main/home')},
|
||||
onPressed: ()=>{navigationContract.goTo(AppRoutes.dashboardHome)},
|
||||
text: "Aceptar",
|
||||
color: theme.getColorFor(ThemeCode.buttonPrimary)
|
||||
),
|
||||
|
||||
@@ -72,9 +72,9 @@ class AccountCreatedScreen extends ConsumerWidget {
|
||||
PrimaryButton(
|
||||
onPressed: () => {
|
||||
if (kidAccount){
|
||||
navigationContract.goTo('/main/home')
|
||||
navigationContract.goTo(AppRoutes.dashboardHome)
|
||||
} else {
|
||||
navigationContract.pushTo('/device_signup')
|
||||
navigationContract.pushTo(AppRoutes.deviceSignup)
|
||||
}
|
||||
},
|
||||
text: "Continuar",
|
||||
|
||||
@@ -17,6 +17,7 @@ class SignupScreen extends ConsumerStatefulWidget {
|
||||
super.key,
|
||||
required this.navigationContract
|
||||
});
|
||||
|
||||
@override
|
||||
ConsumerState<SignupScreen> createState() => _SignupScreenState();
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class _DepositScreenState extends ConsumerState<DepositScreen> {
|
||||
CustomTextField(
|
||||
lines: 3,
|
||||
length: 150,
|
||||
label: "Escribir mensaje a ${kid.name} del motivo del ingreso",
|
||||
label: "Escribir mensaje a ${widget.kid.name} del motivo del ingreso",
|
||||
hint: "Escribe tu mensaje",
|
||||
),
|
||||
const Align(
|
||||
|
||||
@@ -53,7 +53,7 @@ class HomeScreen extends ConsumerWidget {
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: TextButton(
|
||||
onPressed: () => navigationContract.pushTo('/device_signup'),
|
||||
onPressed: () => navigationContract.pushTo(AppRoutes.deviceSignup),
|
||||
child: Text(
|
||||
"+ Añadir otro peque",
|
||||
style: TextStyle(
|
||||
|
||||
@@ -154,7 +154,7 @@ class _WageScreenState extends ConsumerState<WageScreen> {
|
||||
lines: 3,
|
||||
length: 150,
|
||||
label:
|
||||
"Escribir mensaje a ${kid.name} del motivo del ingreso",
|
||||
"Escribir mensaje a ${widget.kid.name} del motivo del ingreso",
|
||||
hint: "Escribe tu mensaje",
|
||||
),
|
||||
const Align(
|
||||
|
||||
@@ -67,14 +67,13 @@ class ActivityListState extends ConsumerState<ActivityList> {
|
||||
children: [
|
||||
Icon(icons[type], color: color),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
Expanded(child: Text(
|
||||
titles[type]!,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
)),
|
||||
const Text("14/01/2005"),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user