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:51:17 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fb45dd8e1b9b3a6014b8741d0464e7f1b1abc13a
fb45dd8e
1 parent
e9128f9a
convert address type to enhanced enum
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
lib/src/enums/address_type.dart
lib/src/enums/address_type.dart
View file @
fb45dd8
/// Address type constants.
enum
AddressType
{
/// Unknown address type.
///
/// Constant Value: 0
unknown
,
unknown
(
0
),
/// Work address.
///
/// Constant Value: 1
work
,
work
(
1
),
/// Home address.
///
/// Constant Value: 2
home
,
home
(
2
);
const
AddressType
(
this
.
rawValue
);
factory
AddressType
.
fromRawValue
(
int
value
)
{
switch
(
value
)
{
case
1
:
return
AddressType
.
work
;
case
2
:
return
AddressType
.
home
;
case
0
:
default
:
return
AddressType
.
unknown
;
}
}
/// The raw address type value.
final
int
rawValue
;
}
...
...
Please
register
or
login
to post a comment