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-21 12:00:43 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9dd082495b4873367535421048d6628000bb9b69
9dd08249
1 parent
c2b78bd1
revert onDetect rename
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
CHANGELOG.md
lib/src/mobile_scanner.dart
CHANGELOG.md
View file @
9dd0824
...
...
@@ -8,7 +8,6 @@ Breaking changes:
*
The
`onPermissionSet` argument of the `MobileScannerController`
is now deprecated.
To handle permission errors, consider catching the result of
`MobileScannerController.start()`
.
*
Toggling the device torch now does nothing if the device has no torch, rather than throwing an error.
*
The
`onDetect` method of `MobileScanner` has been renamed to `onBarcodeDetected`
.
*
The
`MobileScanner` widget no longer starts its `controller`
.
Clients of the widget should call
`controller.start()`
when appropriate.
*
The
`onStart` method has been renamed to `onScannerStarted`
.
...
...
lib/src/mobile_scanner.dart
View file @
9dd0824
...
...
@@ -18,8 +18,8 @@ class MobileScanner extends StatefulWidget {
/// Defaults to [BoxFit.cover].
final
BoxFit
fit
;
/// The function that signals when new barcodes were detected by the [controller].
final
void
Function
(
BarcodeCapture
barcodes
)
onBarcodeDetected
;
/// The function that signals when new codes were detected by the [controller].
final
void
Function
(
BarcodeCapture
barcodes
)
onDetect
;
/// The function that signals when the barcode scanner is started.
final
void
Function
(
MobileScannerArguments
?
arguments
)?
onScannerStarted
;
...
...
@@ -35,7 +35,7 @@ class MobileScanner extends StatefulWidget {
const
MobileScanner
({
this
.
controller
,
this
.
fit
=
BoxFit
.
cover
,
required
this
.
on
BarcodeDetected
,
required
this
.
on
Detect
,
this
.
onScannerStarted
,
this
.
placeholderBuilder
,
super
.
key
,
...
...
@@ -86,7 +86,7 @@ class _MobileScannerState extends State<MobileScanner>
}
_barcodesSubscription
=
_effectiveController
.
barcodes
.
listen
(
widget
.
on
BarcodeDetected
,
widget
.
on
Detect
,
);
final
internalController
=
_controller
;
...
...
Please
register
or
login
to post a comment