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
2024-04-30 13:32:32 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f57d19dbd0da356c47381dea5e89d59b5153bf70
f57d19db
1 parent
c5449517
fix documentation for auto torch mode
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
example/lib/scanner_button_widgets.dart
lib/src/enums/torch_state.dart
lib/src/mobile_scanner_controller.dart
example/lib/scanner_button_widgets.dart
View file @
f57d19d
...
...
@@ -144,8 +144,6 @@ class ToggleFlashlightButton extends StatelessWidget {
iconSize:
32.0
,
icon:
const
Icon
(
Icons
.
flash_auto
),
onPressed:
()
async
{
// This button only turns off the auto mode.
// Perhaps we can switch between on / off / auto?
await
controller
.
toggleTorch
();
},
);
...
...
lib/src/enums/torch_state.dart
View file @
f57d19d
...
...
@@ -2,7 +2,7 @@
enum
TorchState
{
/// The flashlight turns on automatically in low light conditions.
///
/// This is currently only supported on iOS.
/// This is currently only supported on iOS
and MacOS
.
auto
(
2
),
/// The flashlight is off.
...
...
lib/src/mobile_scanner_controller.dart
View file @
f57d19d
...
...
@@ -361,6 +361,9 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
///
/// Does nothing if the device has no torch,
/// or if the camera is not running.
///
/// If the current torch state is [TorchState.auto],
/// the torch is turned on or off depending on its actual current state.
Future
<
void
>
toggleTorch
()
async
{
_throwIfNotInitialized
();
...
...
Please
register
or
login
to post a comment