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-07 12:59:51 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ac9da02bc5162e254c785490458ee5e2845e48ad
ac9da02b
1 parent
fcc66d73
define the platform interface
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
lib/src/mobile_scanner_platform_interface.dart
lib/src/mobile_scanner_platform_interface.dart
View file @
ac9da02
import
'package:flutter/widgets.dart'
;
import
'package:mobile_scanner/src/enums/camera_facing.dart'
;
import
'package:mobile_scanner/src/method_channel/mobile_scanner_method_channel.dart'
;
import
'package:mobile_scanner/src/mobile_scanner_view_attributes.dart'
;
import
'package:plugin_platform_interface/plugin_platform_interface.dart'
;
/// The platform interface for the `mobile_scanner` plugin.
...
...
@@ -22,4 +25,70 @@ abstract class MobileScannerPlatform extends PlatformInterface {
PlatformInterface
.
verifyToken
(
instance
,
_token
);
_instance
=
instance
;
}
/// Analyze a local image file for barcodes.
///
/// Returns whether the file at the given [path] contains a barcode.
Future
<
bool
>
analyzeImage
(
String
path
)
{
throw
UnimplementedError
(
'analyzeImage() has not been implemented.'
);
}
/// Build the camera view for the barcode scanner.
Widget
buildCameraView
(
covariant
MobileScannerViewAttributes
attributes
)
{
throw
UnimplementedError
(
'buildCameraView() has not been implemented.'
);
}
/// Dispose of this [MobileScannerPlatform] instance.
void
dispose
()
{
throw
UnimplementedError
(
'dispose() has not been implemented.'
);
}
/// Reset the zoom scale, so that the camera is fully zoomed out.
Future
<
void
>
resetZoomScale
()
{
throw
UnimplementedError
(
'resetZoomScale() has not been implemented.'
);
}
/// Set the zoom scale of the camera.
///
/// The [zoomScale] must be between `0.0` and `1.0` (both inclusive).
/// A value of `0.0` indicates that the camera is fully zoomed out,
/// while `1.0` indicates that the camera is fully zoomed in.
Future
<
void
>
setZoomScale
(
double
zoomScale
)
{
throw
UnimplementedError
(
'setZoomScale() has not been implemented.'
);
}
/// Start scanning for barcodes.
///
/// Upon calling this method, the necessary camera permission will be requested.
///
/// Returns an instance of [MobileScannerViewAttributes].
Future
<
MobileScannerViewAttributes
>
start
({
CameraFacing
?
cameraDirection
})
{
throw
UnimplementedError
(
'start() has not been implemented.'
);
}
/// Stop the camera.
Future
<
void
>
stop
()
{
throw
UnimplementedError
(
'stop() has not been implemented.'
);
}
/// Switch between the front and back camera.
Future
<
void
>
switchCamera
()
{
throw
UnimplementedError
(
'switchCamera() has not been implemented.'
);
}
/// Switch the torch on or off.
///
/// Does nothing if the device has no torch.
Future
<
void
>
toggleTorch
()
{
throw
UnimplementedError
(
'toggleTorch() has not been implemented.'
);
}
/// Update the scan window to the given [window] rectangle.
///
/// Any barcodes that do not intersect with the given [window] will be ignored.
///
/// If [window] is `null`, the scan window will be reset to the full screen.
Future
<
void
>
updateScanWindow
(
Rect
?
window
)
{
throw
UnimplementedError
(
'updateScanWindow() has not been implemented.'
);
}
}
...
...
Please
register
or
login
to post a comment