From a5dd644a622783d934406c6b239b24424329c5c7 Mon Sep 17 00:00:00 2001 From: aitorarana Date: Wed, 3 Dec 2025 16:43:24 +0100 Subject: [PATCH] merge develop into components --- .../mobile_app/lib/navigation/app_router.dart | 2 +- .../src/login/presentation/login_screen.dart | 7 +- .../login/presentation/phone_code_screen.dart | 2 +- .../presentation/welcome_screen.dart | 162 +++++++++++------- .../presentation/new_password_screen.dart | 2 +- .../src/sign_up/account_created_screen.dart | 4 +- .../auth/lib/src/sign_up/signup_screen.dart | 1 + .../lib/src/presentation/deposit_screen.dart | 2 +- .../lib/src/presentation/home_screen.dart | 2 +- .../lib/src/presentation/wage_screen.dart | 2 +- .../lib/src/core/activity_list.dart | 5 +- packages/navigation/lib/app_routes.dart | 2 + 12 files changed, 121 insertions(+), 72 deletions(-) diff --git a/apps/mobile_app/lib/navigation/app_router.dart b/apps/mobile_app/lib/navigation/app_router.dart index cef2a591..78155c03 100644 --- a/apps/mobile_app/lib/navigation/app_router.dart +++ b/apps/mobile_app/lib/navigation/app_router.dart @@ -15,7 +15,7 @@ late final GoRouter appRouter; void configureAppRouter() { appRouter = GoRouter( navigatorKey: rootNavigatorKey, - initialLocation: AppRoutes.login, + initialLocation: AppRoutes.onboarding, debugLogDiagnostics: true, routes: [ GoRoute( diff --git a/modules/auth/lib/src/login/presentation/login_screen.dart b/modules/auth/lib/src/login/presentation/login_screen.dart index c184e9cf..3cf9cdfe 100644 --- a/modules/auth/lib/src/login/presentation/login_screen.dart +++ b/modules/auth/lib/src/login/presentation/login_screen.dart @@ -19,7 +19,7 @@ class _LoginScreenState extends ConsumerState{ 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{ 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{ 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{ ], ), PrimaryButton( - onPressed: () => widget.navigationContract.goTo('/main/home'), + onPressed: () => widget.navigationContract.goTo(AppRoutes.dashboardHome), text: "Iniciar sesión", color: theme.getColorFor(ThemeCode.buttonPrimary) ), diff --git a/modules/auth/lib/src/login/presentation/phone_code_screen.dart b/modules/auth/lib/src/login/presentation/phone_code_screen.dart index c80878ca..9ee6c3e1 100644 --- a/modules/auth/lib/src/login/presentation/phone_code_screen.dart +++ b/modules/auth/lib/src/login/presentation/phone_code_screen.dart @@ -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), ), diff --git a/modules/auth/lib/src/onboarding/presentation/welcome_screen.dart b/modules/auth/lib/src/onboarding/presentation/welcome_screen.dart index 57c9d79c..41747d8b 100644 --- a/modules/auth/lib/src/onboarding/presentation/welcome_screen.dart +++ b/modules/auth/lib/src/onboarding/presentation/welcome_screen.dart @@ -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 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 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) diff --git a/modules/auth/lib/src/recover_password/presentation/new_password_screen.dart b/modules/auth/lib/src/recover_password/presentation/new_password_screen.dart index 05e38efc..866fe532 100644 --- a/modules/auth/lib/src/recover_password/presentation/new_password_screen.dart +++ b/modules/auth/lib/src/recover_password/presentation/new_password_screen.dart @@ -169,7 +169,7 @@ class NewPasswordScreenState extends ConsumerState { ], ), PrimaryButton( - onPressed: ()=>{navigationContract.goTo('/main/home')}, + onPressed: ()=>{navigationContract.goTo(AppRoutes.dashboardHome)}, text: "Aceptar", color: theme.getColorFor(ThemeCode.buttonPrimary) ), diff --git a/modules/auth/lib/src/sign_up/account_created_screen.dart b/modules/auth/lib/src/sign_up/account_created_screen.dart index 52f47761..f2828367 100644 --- a/modules/auth/lib/src/sign_up/account_created_screen.dart +++ b/modules/auth/lib/src/sign_up/account_created_screen.dart @@ -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", diff --git a/modules/auth/lib/src/sign_up/signup_screen.dart b/modules/auth/lib/src/sign_up/signup_screen.dart index 035559b1..6de7de56 100644 --- a/modules/auth/lib/src/sign_up/signup_screen.dart +++ b/modules/auth/lib/src/sign_up/signup_screen.dart @@ -17,6 +17,7 @@ class SignupScreen extends ConsumerStatefulWidget { super.key, required this.navigationContract }); + @override ConsumerState createState() => _SignupScreenState(); } diff --git a/modules/home/lib/src/presentation/deposit_screen.dart b/modules/home/lib/src/presentation/deposit_screen.dart index 2b2c7da9..73dc9d60 100644 --- a/modules/home/lib/src/presentation/deposit_screen.dart +++ b/modules/home/lib/src/presentation/deposit_screen.dart @@ -135,7 +135,7 @@ class _DepositScreenState extends ConsumerState { 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( diff --git a/modules/home/lib/src/presentation/home_screen.dart b/modules/home/lib/src/presentation/home_screen.dart index b7f4b6f1..9197b9d1 100644 --- a/modules/home/lib/src/presentation/home_screen.dart +++ b/modules/home/lib/src/presentation/home_screen.dart @@ -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( diff --git a/modules/home/lib/src/presentation/wage_screen.dart b/modules/home/lib/src/presentation/wage_screen.dart index aed5a6d6..f4e0c69a 100644 --- a/modules/home/lib/src/presentation/wage_screen.dart +++ b/modules/home/lib/src/presentation/wage_screen.dart @@ -154,7 +154,7 @@ class _WageScreenState extends ConsumerState { 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( diff --git a/modules/notifications/lib/src/core/activity_list.dart b/modules/notifications/lib/src/core/activity_list.dart index 6ebf19da..2908f499 100644 --- a/modules/notifications/lib/src/core/activity_list.dart +++ b/modules/notifications/lib/src/core/activity_list.dart @@ -67,14 +67,13 @@ class ActivityListState extends ConsumerState { 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"), ], ), diff --git a/packages/navigation/lib/app_routes.dart b/packages/navigation/lib/app_routes.dart index 58fe7cba..b441a68c 100644 --- a/packages/navigation/lib/app_routes.dart +++ b/packages/navigation/lib/app_routes.dart @@ -1,8 +1,10 @@ class AppRoutes { static const login = '/login'; + static const signup = '/signup'; static const onboarding = '/onboarding'; static const linkPhone = '/link_phone'; static const phoneCode = '/phone_code'; + static const deviceSignup = '/device_signup'; static const recoverPassword = '/recover_password'; static const dashboard = '/dashboard';