Merge remote-tracking branch 'origin/develop' into components
# Conflicts: # apps/mobile_app/lib/navigation/app_router.dart # apps/mobile_app/pubspec.yaml # modules/auth/lib/src/device_sign_up/add_kid_screen.dart # modules/auth/lib/src/login/presentation/link_phone_screen.dart # modules/auth/lib/src/login/presentation/login_screen.dart # modules/auth/lib/src/login/presentation/phone_code_screen.dart # modules/auth/lib/src/onboarding/presentation/welcome_screen.dart # modules/auth/lib/src/recover_password/presentation/new_password_screen.dart # modules/auth/lib/src/sign_up/signup_screen.dart # modules/home/lib/src/presentation/deposit_screen.dart # modules/home/lib/src/presentation/home_screen.dart # modules/home/lib/src/presentation/wage_screen.dart # modules/notifications/lib/src/core/activity_list.dart # packages/design_system/lib/design_system.dart
This commit is contained in:
@@ -4,90 +4,44 @@ import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:navigation/navigation.dart';
|
||||
|
||||
class WelcomeScreen extends ConsumerStatefulWidget {
|
||||
class WelcomeScreen extends ConsumerWidget {
|
||||
final NavigationContract navigationContract;
|
||||
|
||||
const WelcomeScreen({super.key, required this.navigationContract});
|
||||
|
||||
@override
|
||||
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);
|
||||
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Scaffold(
|
||||
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)
|
||||
]
|
||||
body: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Spacer(),
|
||||
Expanded(
|
||||
child: CarouselView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemExtent: double.infinity,
|
||||
itemSnapping: true,
|
||||
shrinkExtent: 400,
|
||||
children: generateSteps(),
|
||||
),
|
||||
Spacer()
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
FilledButton(
|
||||
onPressed: () => navigationContract.goTo(AppRoutes.linkPhone),
|
||||
child: const Text('Continuar'),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget generateButtons(ThemePort theme, int max, int step){
|
||||
if (step==max) {
|
||||
return PrimaryButton(
|
||||
onPressed: () => navigationContract.goTo('/link_phone'),
|
||||
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('/link_phone'),
|
||||
text: "Omitir",
|
||||
size: 18,
|
||||
weight: FontWeight.w500,
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
void jumpToNext(BuildContext context) {
|
||||
// Navigator.pushReplacement(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (_) => LinkPhoneScreen()),
|
||||
// );
|
||||
return;
|
||||
}
|
||||
|
||||
List<Widget> generateSteps() {
|
||||
@@ -99,12 +53,12 @@ class WelcomeScreenState extends ConsumerState{
|
||||
Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
"Aprende a gestionar su dinero",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
),
|
||||
Text(
|
||||
const Text(
|
||||
"Tu peque crea hábitos y se divierte mientras lo hace",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
@@ -120,12 +74,12 @@ class WelcomeScreenState extends ConsumerState{
|
||||
Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
"Tranquilidad en cada pago que hace",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
),
|
||||
Text(
|
||||
const Text(
|
||||
"Supervisa sus gastos, fija límites y acompáñale en cada paso",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
@@ -141,12 +95,12 @@ class WelcomeScreenState extends ConsumerState{
|
||||
Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
"Pagos fáciles y seguros, en sus manos",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500, letterSpacing: 0)
|
||||
),
|
||||
Text(
|
||||
const Text(
|
||||
"Podrá pagar desde su reloj.\n Sin móvil ni efectivo",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 18, letterSpacing: 0)
|
||||
|
||||
Reference in New Issue
Block a user