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
2022-11-19 18:00:27 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5bbfb816f70afa6e67d0a137b5f682d3f6ee05bd
5bbfb816
1 parent
de06313c
remove onPermissionSet from MobileScanner widget; fix doc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
lib/src/mobile_scanner.dart
lib/src/mobile_scanner.dart
View file @
5bbfb81
...
...
@@ -14,11 +14,6 @@ class MobileScanner extends StatefulWidget {
/// The controller of the camera.
final
MobileScannerController
?
controller
;
/// Calls the provided [onPermissionSet] callback when the permission is set.
// @Deprecated('Use the [onPermissionSet] paremeter in the [MobileScannerController] instead.')
// ignore: deprecated_consistency
final
Function
(
bool
permissionGranted
)?
onPermissionSet
;
/// Function that gets called when a Barcode is detected.
///
/// [barcode] The barcode object with all information about the scanned code.
...
...
@@ -37,7 +32,8 @@ class MobileScanner extends StatefulWidget {
/// Whether to automatically resume the camera when the application is resumed
final
bool
autoResume
;
/// Create a [MobileScanner] with a [controller], the [controller] must has been initialized.
/// Create a [MobileScanner] with a [controller].
/// The [controller] must have been initialized, using [MobileScannerController.start].
const
MobileScanner
({
super
.
key
,
required
this
.
onDetect
,
...
...
@@ -45,8 +41,6 @@ class MobileScanner extends StatefulWidget {
this
.
controller
,
this
.
autoResume
=
true
,
this
.
fit
=
BoxFit
.
cover
,
@Deprecated
(
'Use the [onPermissionSet] paremeter in the [MobileScannerController] instead.'
)
this
.
onPermissionSet
,
});
@override
...
...
@@ -61,8 +55,7 @@ class _MobileScannerState extends State<MobileScanner>
void
initState
()
{
super
.
initState
();
WidgetsBinding
.
instance
.
addObserver
(
this
);
controller
=
widget
.
controller
??
MobileScannerController
(
onPermissionSet:
widget
.
onPermissionSet
);
controller
=
widget
.
controller
??
MobileScannerController
();
if
(!
controller
.
isStarting
)
{
_startScanner
();
}
...
...
@@ -141,8 +134,7 @@ class _MobileScannerState extends State<MobileScanner>
}
}
else
{
if
(
widget
.
controller
==
null
)
{
controller
=
MobileScannerController
(
onPermissionSet:
widget
.
onPermissionSet
);
controller
=
MobileScannerController
();
}
else
if
(
oldWidget
.
controller
!=
widget
.
controller
)
{
controller
=
widget
.
controller
!;
}
...
...
Please
register
or
login
to post a comment