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-12-08 11:31:04 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4051f8dc8d13137c5fdde3ace49ee768fa840844
4051f8dc
1 parent
208d2486
feat: add hasTorch function
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
CHANGELOG.md
lib/src/mobile_scanner_controller.dart
CHANGELOG.md
View file @
4051f8d
...
...
@@ -19,6 +19,7 @@ Improvements:
Features:
*
Added a new
`placeholderBuilder` function to the `MobileScanner`
widget to customize the preview placeholder.
*
Added
`autoStart`
parameter to MobileScannerController(). If set to false, controller won't start automatically.
*
Added
`hasTorch`
function on MobileScannerController(). After starting the controller, you can check if the device has a torch.
Fixed:
*
Fixed a memory leak where the
`MobileScanner`
widget would never close its subscription to the barcode events.
...
...
lib/src/mobile_scanner_controller.dart
View file @
4051f8d
...
...
@@ -101,6 +101,19 @@ class MobileScannerController {
bool
?
_hasTorch
;
/// Returns whether the device has a torch.
///
/// Throws an error if the controller is not initialized.
bool
get
hasTorch
{
if
(
_hasTorch
==
null
)
{
throw
const
MobileScannerException
(
errorCode:
MobileScannerErrorCode
.
controllerUninitialized
,
);
}
return
_hasTorch
!;
}
/// Set the starting arguments for the camera
Map
<
String
,
dynamic
>
_argumentsToMap
({
CameraFacing
?
cameraFacingOverride
})
{
final
Map
<
String
,
dynamic
>
arguments
=
{};
...
...
Please
register
or
login
to post a comment