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-03-02 10:45:18 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4da55967ffac45b1ff66ab5b857d5dc4020c9a71
4da55967
1 parent
a36dd53c
imp: update example app with start/stop button
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletions
example/lib/barcode_scanner_controller.dart
example/lib/barcode_scanner_controller.dart
View file @
4da5596
...
...
@@ -19,6 +19,8 @@ class _BarcodeScannerWithControllerState
// facing: CameraFacing.front,
);
bool
isStarted
=
true
;
@override
Widget
build
(
BuildContext
context
)
{
return
MaterialApp
(
...
...
@@ -69,9 +71,21 @@ class _BarcodeScannerWithControllerState
iconSize:
32.0
,
onPressed:
()
=>
controller
.
toggleTorch
(),
),
IconButton
(
color:
Colors
.
white
,
icon:
isStarted
?
const
Icon
(
Icons
.
stop
)
:
const
Icon
(
Icons
.
play_arrow
),
iconSize:
32.0
,
onPressed:
()
=>
setState
(()
{
isStarted
?
controller
.
stop
()
:
controller
.
start
();
isStarted
=
!
isStarted
;
})),
Center
(
child:
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
1
2
0
,
width:
MediaQuery
.
of
(
context
).
size
.
width
-
1
6
0
,
height:
50
,
child:
FittedBox
(
child:
Text
(
...
...
Please
register
or
login
to post a comment