Skip to content

Commit

Permalink
https://github.com/caseyryan/flutter_multi_formatter/pull/140
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyryan committed Sep 12, 2023
1 parent ce66478 commit 5fa791c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [2.11.8]
Merged https://github.com/caseyryan/flutter_multi_formatter/pull/140
adding isForce parameter to getAllCountryCodes
## [2.11.7]
- Fixed missing Luhn algo check in isCardNumberValid function
## [2.11.6]
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.11.7"
version: "2.11.8"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
9 changes: 6 additions & 3 deletions lib/formatters/phone_input_formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ class PhoneInputFormatter extends TextInputFormatter {
if (shouldCorrectNumber && onlyNumbers.length == 2) {
/// хак специально для России, со вводом номера с восьмерки
/// меняем ее на 7
var isRussianWrongNumber = onlyNumbers[0] == '8' && onlyNumbers[1] == '9' ||
onlyNumbers[0] == '8' && onlyNumbers[1] == '3';
var isRussianWrongNumber =
onlyNumbers[0] == '8' && onlyNumbers[1] == '9' ||
onlyNumbers[0] == '8' && onlyNumbers[1] == '3';
if (isRussianWrongNumber) {
onlyNumbers = '7${onlyNumbers[1]}';
_countryData = null;
Expand All @@ -103,7 +104,8 @@ class PhoneInputFormatter extends TextInputFormatter {
);
}

final isAustralianPhoneNumber = onlyNumbers[0] == '0' && onlyNumbers[1] == '4';
final isAustralianPhoneNumber =
onlyNumbers[0] == '0' && onlyNumbers[1] == '4';
if (isAustralianPhoneNumber) {
onlyNumbers = '61${onlyNumbers[1]}';
_countryData = null;
Expand Down Expand Up @@ -706,6 +708,7 @@ class PhoneCodes {
/// countryRU. If you want to translate the names of the countries
/// to your language, please feel free to do it and make a pull request.
/// Just keep the naming convention like countryBR, countryDE and so on
/// [isForce] pass true if you need to update cache
static List<PhoneCountryData> getAllCountryDatas({
String langCode = '',
bool isForce = false,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_multi_formatter
description: A package of formatters for international phone numbers, credit / debit cards and a masked formatter
version: 2.11.7
version: 2.11.8
homepage: https://github.com/caseyryan/flutter_multi_formatter

environment:
Expand Down

0 comments on commit 5fa791c

Please sign in to comment.