-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: localizations and shadow styles (#10)
- Loading branch information
1 parent
16b5b3b
commit f95ac34
Showing
32 changed files
with
484 additions
and
286 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:ice/generated/app_localizations.dart'; | ||
|
||
extension ThemeGetter on BuildContext { | ||
/// Usage example: `context.theme` | ||
ThemeData get theme => Theme.of(this); | ||
} | ||
|
||
extension I18nGetter on BuildContext { | ||
I18n get i18n => I18n.of(this)!; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
import 'package:ice/app/constants/ui.dart'; | ||
import 'package:ice/app/extensions/build_context.dart'; | ||
import 'package:ice/app/extensions/theme_data.dart'; | ||
import 'package:ice/app/features/auth/data/models/auth_state.dart'; | ||
|
@@ -21,6 +20,7 @@ import 'package:ice/app/shared/widgets/auth_header/auth_header.dart'; | |
import 'package:ice/app/shared/widgets/button/button.dart'; | ||
import 'package:ice/app/shared/widgets/inputs/text_fields.dart'; | ||
import 'package:ice/app/shared/widgets/modal_wrapper.dart'; | ||
import 'package:ice/app/shared/widgets/screen_side_offset/screen_side_offset.dart'; | ||
import 'package:ice/app/shared/widgets/secured_by/secured_by.dart'; | ||
import 'package:ice/app/shared/widgets/socials/socials.dart'; | ||
import 'package:ice/app/shared/widgets/terms_privacy/terms_privacy.dart'; | ||
|
@@ -53,22 +53,20 @@ class AuthPage extends HookConsumerWidget { | |
final PhoneNumberController numberController = PhoneNumberController(); | ||
|
||
return Scaffold( | ||
body: Container( | ||
margin: const EdgeInsets.symmetric(horizontal: kDefaultPadding), | ||
body: ScreenSideOffset.large( | ||
child: Column( | ||
children: <Widget>[ | ||
AuthHeaderWidget( | ||
title: 'Get started', | ||
description: 'Choose your login method', | ||
title: context.i18n.auth_signIn_title, | ||
description: context.i18n.auth_signIn_description, | ||
), | ||
// EmailInput(formKey: emailFormKey), | ||
if (isEmailMode) | ||
InputField( | ||
leadingIcon: Image.asset( | ||
Assets.images.fieldEmail.path, | ||
color: context.theme.appColors.primaryText, | ||
), | ||
label: 'Email address', | ||
label: context.i18n.auth_signIn_input_email, | ||
controller: emailController.controller, | ||
validator: (String? value) => emailController.onVerify(), | ||
showLeadingSeparator: true, | ||
|
@@ -82,12 +80,11 @@ class AuthPage extends HookConsumerWidget { | |
context, | ||
), | ||
), | ||
label: 'Phone number', | ||
label: context.i18n.auth_signIn_input_phone_number, | ||
controller: numberController.controller, | ||
validator: (String? value) => numberController.onVerify(), | ||
showLeadingSeparator: true, | ||
), | ||
|
||
const SizedBox( | ||
height: 16, | ||
), | ||
|
@@ -111,14 +108,14 @@ class AuthPage extends HookConsumerWidget { | |
.read(authProvider.notifier) | ||
.signIn(email: '[email protected]', password: '123'), | ||
}, | ||
label: const Text('Continue'), | ||
label: Text(context.i18n.button_continue), | ||
mainAxisSize: MainAxisSize.max, | ||
), | ||
), | ||
Padding( | ||
padding: const EdgeInsets.only(top: 14, bottom: 14), | ||
child: Text( | ||
'or', | ||
context.i18n.auth_signIn_or, | ||
style: context.theme.appTextThemes.caption | ||
.copyWith(color: context.theme.appColors.tertararyText), | ||
), | ||
|
@@ -135,7 +132,9 @@ class AuthPage extends HookConsumerWidget { | |
ref.read(isEmailModeProvider.notifier).state = !isEmailMode; | ||
}, | ||
label: Text( | ||
isEmailMode ? 'Continue with Email' : 'Continue with Phone', | ||
isEmailMode | ||
? context.i18n.auth_signIn_button_email | ||
: context.i18n.auth_signIn_button_phone_number, | ||
), | ||
mainAxisSize: MainAxisSize.max, | ||
), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.