diff --git a/packages/espressocash_app/lib/features/ramp/screens/ramp_onboarding_screen.dart b/packages/espressocash_app/lib/features/ramp/screens/ramp_onboarding_screen.dart index 302fe6759..a5191c307 100644 --- a/packages/espressocash_app/lib/features/ramp/screens/ramp_onboarding_screen.dart +++ b/packages/espressocash_app/lib/features/ramp/screens/ramp_onboarding_screen.dart @@ -93,13 +93,13 @@ class _RampOnboardingScreenState extends State<RampOnboardingScreen> { header: FormPageHeader( title: Text(context.l10n.rampBasicInfoRequired), description: Text(context.l10n.yourEmailDisclaimer), + iconAlignment: Alignment.topCenter, icon: Assets.images.profileGraphic, ), child: Column( children: [ _ProfileTextField( emailController: _firstNameController, - rampType: widget.rampType, inputType: TextInputType.name, placeholder: context.l10n.yourFirstNamePlaceholder, textCapitalization: TextCapitalization.words, @@ -107,7 +107,6 @@ class _RampOnboardingScreenState extends State<RampOnboardingScreen> { const SizedBox(height: 14), _ProfileTextField( emailController: _lastNameController, - rampType: widget.rampType, inputType: TextInputType.name, placeholder: context.l10n.yourLastNamePlaceholder, textCapitalization: TextCapitalization.words, @@ -115,7 +114,6 @@ class _RampOnboardingScreenState extends State<RampOnboardingScreen> { const SizedBox(height: 14), _ProfileTextField( emailController: _emailController, - rampType: widget.rampType, inputType: TextInputType.emailAddress, placeholder: context.l10n.yourEmailPlaceholder, ), @@ -146,20 +144,17 @@ class _RampOnboardingScreenState extends State<RampOnboardingScreen> { class _ProfileTextField extends StatelessWidget { const _ProfileTextField({ required this.emailController, - required this.rampType, required this.inputType, required this.placeholder, this.textCapitalization = TextCapitalization.none, }); final TextEditingController emailController; - final RampType rampType; final TextInputType inputType; final TextCapitalization textCapitalization; final String placeholder; - static const _onRampTextfieldColor = Color(0xFFB84D12); - static const _offRampTextfieldColor = Color(0xFF9D8A59); + static const _rampTextfieldColor = Color(0xFF9D8A59); @override Widget build(BuildContext context) => CpTextField( @@ -173,10 +168,7 @@ class _ProfileTextField extends StatelessWidget { inputType: inputType, textInputAction: TextInputAction.next, textCapitalization: textCapitalization, - backgroundColor: switch (rampType) { - RampType.onRamp => _onRampTextfieldColor, - RampType.offRamp => _offRampTextfieldColor, - }, + backgroundColor: _rampTextfieldColor, placeholder: placeholder, placeholderColor: Colors.white, textColor: Colors.white, diff --git a/packages/espressocash_app/lib/features/ramp/widgets/ramp_page.dart b/packages/espressocash_app/lib/features/ramp/widgets/ramp_page.dart index 6e25060e7..2c03457b8 100644 --- a/packages/espressocash_app/lib/features/ramp/widgets/ramp_page.dart +++ b/packages/espressocash_app/lib/features/ramp/widgets/ramp_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import '../../../gen/assets.gen.dart'; import '../../../l10n/l10n.dart'; import '../../../ui/form_page.dart'; import '../models/ramp_type.dart'; @@ -23,15 +24,11 @@ class RampPage extends StatelessWidget { RampType.offRamp => context.l10n.ramp_btnCashOut, }; - final colorTheme = switch (type) { - RampType.onRamp => FormPageColorTheme.orange, - RampType.offRamp => FormPageColorTheme.gold, - }; - return FormPage( title: Text(title.toUpperCase()), - colorTheme: colorTheme, + colorTheme: FormPageColorTheme.gold, header: header, + backgroundImage: Assets.images.blank, child: child, ); } diff --git a/packages/espressocash_app/lib/ui/form_page.dart b/packages/espressocash_app/lib/ui/form_page.dart index c151dd109..98d377b83 100644 --- a/packages/espressocash_app/lib/ui/form_page.dart +++ b/packages/espressocash_app/lib/ui/form_page.dart @@ -80,9 +80,11 @@ class FormPageHeader extends StatelessWidget { required this.title, required this.description, required this.icon, + this.iconAlignment = Alignment.bottomCenter, }); final AssetGenImage icon; + final AlignmentGeometry iconAlignment; final Widget title; final Widget description; @@ -91,7 +93,7 @@ class FormPageHeader extends StatelessWidget { children: [ Expanded( child: Align( - alignment: Alignment.bottomCenter, + alignment: iconAlignment, child: icon.image(), ), ),