Skip to content

Commit 875a2d4

Browse files
committed
add demo
1 parent 7576d89 commit 875a2d4

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
1+
## 8.2.1
2+
- add demo link in readme
23

34
## 8.2.0
45
- added VOIP support

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ The advantage of this lib instead of libphonenumber is that it instantly support
1313
- Supports eastern arabic digits
1414
- Uses best-in-class metadata from Google's libPhoneNumber project.
1515

16+
## Demo
17+
18+
[demo](https://cedvdb.github.io/phone_numbers_parser/)
1619

1720
## Contributing
1821

demo/lib/main.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ class _MyHomePageState extends State<MyHomePage> {
5252
label: Text('Phone number'),
5353
),
5454
onChanged: (value) {
55-
setState(() => this.phoneNumber = PhoneNumber.parse(value));
55+
try {
56+
setState(() => this.phoneNumber = PhoneNumber.parse(value));
57+
} catch (e) {
58+
setState(() => this.phoneNumber = null);
59+
}
5660
},
5761
),
5862
const SizedBox(height: 12),

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: phone_numbers_parser
22
description: Dart library for parsing phone numbers. Inspired by Google's libphonenumber and PhoneNumberKit for ios.
3-
version: 8.2.0
3+
version: 8.2.1
44
homepage: https://github.com/cedvdb/phone_number_parser
55

66
environment:

0 commit comments

Comments
 (0)