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
Julian Steenbakker
2022-09-28 15:10:25 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a262c35755b30b908440681f077d275339cecc16
a262c357
1 parent
64bf5c6d
style: flutter format
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
lib/src/mobile_scanner.dart
lib/src/mobile_scanner_controller.dart
lib/src/mobile_scanner.dart
View file @
a262c35
...
...
@@ -52,7 +52,8 @@ class _MobileScannerState extends State<MobileScanner>
void
initState
()
{
super
.
initState
();
WidgetsBinding
.
instance
.
addObserver
(
this
);
controller
=
widget
.
controller
??
MobileScannerController
(
onPermissionSet:
widget
.
onPermissionSet
);
controller
=
widget
.
controller
??
MobileScannerController
(
onPermissionSet:
widget
.
onPermissionSet
);
if
(!
controller
.
isStarting
)
controller
.
start
();
}
...
...
@@ -122,7 +123,8 @@ class _MobileScannerState extends State<MobileScanner>
}
}
else
{
if
(
widget
.
controller
==
null
)
{
controller
=
MobileScannerController
(
onPermissionSet:
widget
.
onPermissionSet
);
controller
=
MobileScannerController
(
onPermissionSet:
widget
.
onPermissionSet
);
}
else
if
(
oldWidget
.
controller
!=
widget
.
controller
)
{
controller
=
widget
.
controller
!;
}
...
...
lib/src/mobile_scanner_controller.dart
View file @
a262c35
...
...
@@ -212,7 +212,8 @@ class MobileScannerController {
hasTorch
=
startResult
[
'torchable'
]
as
bool
?
??
false
;
if
(
kIsWeb
)
{
onPermissionSet
?.
call
(
true
);
// If we reach this line, it means camera permission has been granted
onPermissionSet
?.
call
(
true
);
// If we reach this line, it means camera permission has been granted
args
.
value
=
MobileScannerArguments
(
webId:
startResult
[
'ViewID'
]
as
String
?,
...
...
Please
register
or
login
to post a comment