-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Phone number tab sign in UI with internationalization (#65)
## Description * Sign in page phone number tab UI. Implementation of issue #67 * Internationalization of text in both french and English <img src="https://user-images.githubusercontent.com/60433438/218272037-aa21da14-eed4-4207-9b08-0defeca17fc3.png" width= "500" height="800"> <img src="https://user-images.githubusercontent.com/60433438/218272048-96bbc46d-2db5-497b-b6b8-d852271ce5d8.png" width= "500" height="800"> ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [x] ✨ New feature (non-breaking change which adds functionality) - [ ] 🛠️ Bug fix (non-breaking change which fixes an issue) - [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 Code refactor - [ ] ✅ Build configuration change - [ ] 📝 Documentation - [ ] 🗑️ Chore ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read and ran all relevant commands as specififed in the Running Tests section of the [Contributor Guide]. - [ ] The title of the PR follows the [Conventional Commits] guideline - [ ] My local branch follows the naming standards in the [Deepsource Branch Naming Convention] or [Biodiversity Branch Naming Convention] - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated `pubspec.yaml` with an appropriate new version according to the [pub versioning philosophy], - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] All existing and new tests are passing. [Contributor Guide]: https://github.com/FlutterPlaza/.github/blob/main/CONTRIBUTING.md [Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0-beta.4/ [pub versioning philosophy]: https://dart.dev/tools/pub/versioning [Biodiversity Branch Naming Convention]: https://bit.ly/3DyYSwM [Deepsource Branch Naming Convention]: https://bit.ly/3Y08Gs4
- Loading branch information
Showing
9 changed files
with
105 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:fpb/l10n/l10n.dart'; | ||
import 'package:intl_phone_field/intl_phone_field.dart'; | ||
|
||
|
||
class PhoneNumberInput extends StatelessWidget { | ||
const PhoneNumberInput({ | ||
super.key, | ||
required this.l10n, | ||
required this.cts, | ||
this.node, | ||
this.textController, | ||
}); | ||
|
||
final AppLocalizations l10n; | ||
final FocusNode? node; | ||
final TextEditingController? textController; | ||
final BoxConstraints cts; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = Theme.of(context); | ||
final style = theme.textTheme; | ||
|
||
return Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
l10n.signInPhoneNumberFieldLabel, | ||
style: style.titleSmall, | ||
), | ||
SizedBox( | ||
height: cts.maxHeight * 0.01, | ||
), | ||
IntlPhoneField( | ||
disableLengthCheck: true, | ||
flagsButtonPadding: EdgeInsets.all( | ||
cts.maxHeight * 0.01, | ||
), | ||
dropdownIconPosition: IconPosition.trailing, | ||
decoration: InputDecoration( | ||
contentPadding: EdgeInsets.all( | ||
cts.maxHeight * 0.025, | ||
), | ||
labelText: '1 234 89 9000', | ||
border: OutlineInputBorder( | ||
borderRadius: BorderRadius.all( | ||
Radius.circular( | ||
cts.maxHeight * 0.025, | ||
), | ||
), | ||
), | ||
), | ||
initialCountryCode: 'US', | ||
), | ||
SizedBox( | ||
height: cts.maxHeight * .02, | ||
) | ||
], | ||
); | ||
} | ||
} |
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