Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
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
Navaron Bracke
2023-10-22 19:52:51 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1463e7a8541b33056bf5d1357a67d86f35c10d2b
1463e7a8
1 parent
fb45dd8e
convert phone type to enhanced enum
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
lib/src/enums/phone_type.dart
lib/src/enums/phone_type.dart
View file @
1463e7a
/// Phone number format type constants.
enum
PhoneType
{
/// Unknown phone type.
///
/// Constant Value: 0
unknown
,
unknown
(
0
),
/// Work phone.
///
/// Constant Value: 1
work
,
work
(
1
),
/// Home phone.
///
/// Constant Value: 2
home
,
home
(
2
),
/// Fax machine.
///
/// Constant Value: 3
fax
,
fax
(
3
),
/// Mobile phone.
///
/// Constant Value: 4
mobile
,
mobile
(
4
);
const
PhoneType
(
this
.
rawValue
);
factory
PhoneType
.
fromRawValue
(
int
value
)
{
switch
(
value
)
{
case
1
:
return
PhoneType
.
work
;
case
2
:
return
PhoneType
.
home
;
case
3
:
return
PhoneType
.
fax
;
case
4
:
return
PhoneType
.
mobile
;
case
0
:
default
:
return
PhoneType
.
unknown
;
}
}
/// The raw phone type value.
final
int
rawValue
;
}
...
...
Please
register
or
login
to post a comment