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-02-17 09:40:46 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
95a8f8ff9c38c6c6d77c8e5fd785d8f50034d867
95a8f8ff
1 parent
7d6bdd17
doc: update api docs
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
lib/src/mobile_scanner.dart
lib/src/mobile_scanner.dart
View file @
95a8f8f
...
...
@@ -7,9 +7,23 @@ enum Ratio { ratio_4_3, ratio_16_9 }
/// A widget showing a live camera preview.
class
MobileScanner
extends
StatefulWidget
{
/// The controller of the camera.
final
MobileScannerController
?
controller
;
/// Function that gets called when a Barcode is detected.
///
/// [barcode] The barcode object with all information about the scanned code.
/// [args] Information about the state of the MobileScanner widget
final
Function
(
Barcode
barcode
,
MobileScannerArguments
args
)?
onDetect
;
/// TODO: Function that gets called when the Widget is initialized. Can be usefull
/// to check wether the device has a torch(flash) or not.
///
/// [args] Information about the state of the MobileScanner widget
// final Function(MobileScannerArguments args)? onInitialize;
/// Handles how the widget should fit the screen.
final
BoxFit
fit
;
/// Create a [MobileScanner] with a [controller], the [controller] must has been initialized.
...
...
@@ -64,7 +78,6 @@ class _MobileScannerState extends State<MobileScanner>
}
else
{
controller
.
barcodes
.
listen
(
(
a
)
=>
widget
.
onDetect
!(
a
,
value
as
MobileScannerArguments
));
debugPrint
(
' size MediaQuery
${MediaQuery.of(context).size}
'
);
return
ClipRect
(
child:
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
...
...
Please
register
or
login
to post a comment