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:58:46 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d68bb2bda566b1c1a4400bb324fcde2f0b2109a9
d68bb2bd
1 parent
1463e7a8
convert mobile scanner state to enhanced enum
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
lib/src/enums/mobile_scanner_state.dart
lib/src/enums/mobile_scanner_state.dart
View file @
d68bb2b
/// The authorization state of the scanner.
enum
MobileScannerState
{
/// The scanner has not yet requested the required permissions.
undetermined
,
undetermined
(
0
)
,
/// The scanner has the required permissions.
authorized
,
authorized
(
1
)
,
/// The user denied the required permissions.
denied
denied
(
2
);
const
MobileScannerState
(
this
.
rawValue
);
factory
MobileScannerState
.
fromRawValue
(
int
value
)
{
switch
(
value
)
{
case
0
:
return
MobileScannerState
.
undetermined
;
case
1
:
return
MobileScannerState
.
authorized
;
case
2
:
return
MobileScannerState
.
denied
;
default
:
throw
ArgumentError
.
value
(
value
,
'value'
,
'Invalid raw value.'
);
}
}
/// The raw value for the state.
final
int
rawValue
;
}
...
...
Please
register
or
login
to post a comment