Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jonatas
2020-10-17 13:39:03 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bde443803e7d3ac2e74ed00c0e627e1c7b8a8c90
bde44380
1 parent
86372918
fix phone number validator
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
lib/get_utils/src/get_utils/get_utils.dart
lib/get_utils/src/get_utils/get_utils.dart
View file @
bde4438
...
...
@@ -203,8 +203,10 @@ class GetUtils {
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$'
);
/// Checks if string is phone number.
static
bool
isPhoneNumber
(
String
s
)
=>
hasMatch
(
s
,
r'^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$'
);
static
bool
isPhoneNumber
(
String
s
)
{
if
(
s
==
null
||
s
.
length
>
16
||
s
.
length
<
9
)
return
false
;
return
hasMatch
(
s
,
r'^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[-\s\./0-9]*$'
);
}
/// Checks if string is DateTime (UTC or Iso8601).
static
bool
isDateTime
(
String
s
)
=>
...
...
Please
register
or
login
to post a comment