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
2023-11-08 18:18:56 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b64e5fa6098bb8580b4773caa9de68aee22bf3a4
b64e5fa6
1 parent
03812538
throw in zoom scale methods if not initialized
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
lib/src/mobile_scanner_controller.dart
lib/src/mobile_scanner_controller.dart
View file @
b64e5fa
...
...
@@ -161,6 +161,10 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
/// Reset the zoom scale of the camera.
Future
<
void
>
resetZoomScale
()
async
{
_throwIfNotInitialized
();
// When the platform has updated the zoom scale,
// it will send an update through the zoom scale state event stream.
await
MobileScannerPlatform
.
instance
.
resetZoomScale
();
}
...
...
@@ -171,8 +175,13 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
/// If the [zoomScale] is out of range,
/// it is adjusted to fit within the allowed range.
Future
<
void
>
setZoomScale
(
double
zoomScale
)
async
{
_throwIfNotInitialized
();
final
double
clampedZoomScale
=
zoomScale
.
clamp
(
0.0
,
1.0
);
// Update the zoom scale state to the new state.
// When the platform has updated the zoom scale,
// it will send an update through the zoom scale state event stream.
await
MobileScannerPlatform
.
instance
.
setZoomScale
(
clampedZoomScale
);
}
...
...
@@ -253,8 +262,6 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
/// Switches the flashlight on or off.
///
/// Does nothing if the device has no torch.
///
/// Throws if the controller was not initialized.
Future
<
void
>
toggleTorch
()
async
{
final
bool
hasTorch
;
...
...
Please
register
or
login
to post a comment