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-05-06 16:56:08 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f5caa9f60424609dba514fbd793ff66c894a87c1
f5caa9f6
1 parent
e4036c7e
fix autoStart values for samples
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
4 additions
and
55 deletions
example/lib/barcode_scanner_controller.dart
example/lib/barcode_scanner_listview.dart
example/lib/barcode_scanner_pageview.dart
example/lib/barcode_scanner_returning_image.dart
example/lib/barcode_scanner_window.dart
example/lib/barcode_scanner_zoom.dart
example/lib/mobile_scanner_overlay.dart
example/lib/barcode_scanner_controller.dart
View file @
f5caa9f
...
...
@@ -16,12 +16,9 @@ class BarcodeScannerWithController extends StatefulWidget {
class
_BarcodeScannerWithControllerState
extends
State
<
BarcodeScannerWithController
>
with
WidgetsBindingObserver
{
final
MobileScannerController
controller
=
MobileScannerController
(
torchEnabled:
true
,
useNewCameraSelector:
true
,
// formats: [BarcodeFormat.qrCode]
// facing: CameraFacing.front,
// detectionSpeed: DetectionSpeed.normal
// detectionTimeoutMs: 1000,
// returnImage: false,
autoStart:
false
,
torchEnabled:
true
,
useNewCameraSelector:
true
,
);
Barcode
?
_barcode
;
...
...
example/lib/barcode_scanner_listview.dart
View file @
f5caa9f
...
...
@@ -15,20 +15,8 @@ class BarcodeScannerListView extends StatefulWidget {
class
_BarcodeScannerListViewState
extends
State
<
BarcodeScannerListView
>
{
final
MobileScannerController
controller
=
MobileScannerController
(
torchEnabled:
true
,
// formats: [BarcodeFormat.qrCode]
// facing: CameraFacing.front,
// detectionSpeed: DetectionSpeed.normal
// detectionTimeoutMs: 1000,
// returnImage: false,
);
@override
void
initState
()
{
super
.
initState
();
controller
.
start
();
}
Widget
_buildBarcodesListView
()
{
return
StreamBuilder
<
BarcodeCapture
>(
stream:
controller
.
barcodes
,
...
...
example/lib/barcode_scanner_pageview.dart
View file @
f5caa9f
...
...
@@ -13,18 +13,11 @@ class BarcodeScannerPageView extends StatefulWidget {
}
class
_BarcodeScannerPageViewState
extends
State
<
BarcodeScannerPageView
>
{
final
MobileScannerController
controller
=
MobileScannerController
(
autoStart:
false
);
final
MobileScannerController
controller
=
MobileScannerController
();
final
PageController
pageController
=
PageController
();
@override
void
initState
()
{
super
.
initState
();
unawaited
(
controller
.
start
());
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'With PageView'
)),
...
...
example/lib/barcode_scanner_returning_image.dart
View file @
f5caa9f
...
...
@@ -18,20 +18,10 @@ class _BarcodeScannerReturningImageState
extends
State
<
BarcodeScannerReturningImage
>
{
final
MobileScannerController
controller
=
MobileScannerController
(
torchEnabled:
true
,
// formats: [BarcodeFormat.qrCode]
// facing: CameraFacing.front,
// detectionSpeed: DetectionSpeed.normal
// detectionTimeoutMs: 1000,
returnImage:
true
,
);
@override
void
initState
()
{
super
.
initState
();
controller
.
start
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Returning image'
)),
...
...
example/lib/barcode_scanner_window.dart
View file @
f5caa9f
...
...
@@ -17,13 +17,6 @@ class _BarcodeScannerWithScanWindowState
extends
State
<
BarcodeScannerWithScanWindow
>
{
final
MobileScannerController
controller
=
MobileScannerController
();
@override
void
initState
()
{
super
.
initState
();
controller
.
start
();
}
Widget
_buildBarcodeOverlay
()
{
return
ValueListenableBuilder
(
valueListenable:
controller
,
...
...
example/lib/barcode_scanner_zoom.dart
View file @
f5caa9f
...
...
@@ -22,12 +22,6 @@ class _BarcodeScannerWithZoomState extends State<BarcodeScannerWithZoom> {
double
_zoomFactor
=
0.0
;
@override
void
initState
()
{
super
.
initState
();
controller
.
start
();
}
Widget
_buildZoomScaleSlider
()
{
return
ValueListenableBuilder
(
valueListenable:
controller
,
...
...
example/lib/mobile_scanner_overlay.dart
View file @
f5caa9f
...
...
@@ -16,12 +16,6 @@ class _BarcodeScannerWithOverlayState extends State<BarcodeScannerWithOverlay> {
);
@override
void
initState
()
{
super
.
initState
();
controller
.
start
();
}
@override
Widget
build
(
BuildContext
context
)
{
final
scanWindow
=
Rect
.
fromCenter
(
center:
MediaQuery
.
sizeOf
(
context
).
center
(
Offset
.
zero
),
...
...
Please
register
or
login
to post a comment