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-09 10:40:59 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0ac899bdc0470f5c88192733ee29a8d23d9dfb82
0ac899bd
1 parent
5d7d5855
remove the builder from the controller sample
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
44 deletions
example/lib/barcode_scanner_controller.dart
example/lib/barcode_scanner_controller.dart
View file @
0ac899b
...
...
@@ -50,54 +50,49 @@ class _BarcodeScannerWithControllerState
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'With controller'
)),
backgroundColor:
Colors
.
black
,
body:
Builder
(
builder:
(
context
)
{
return
Stack
(
children:
[
MobileScanner
(
controller:
controller
,
errorBuilder:
(
context
,
error
,
child
)
{
return
ScannerErrorWidget
(
error:
error
);
},
fit:
BoxFit
.
contain
,
),
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
100
,
color:
Colors
.
black
.
withOpacity
(
0.4
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
ToggleFlashlightButton
(
controller:
controller
),
StartStopMobileScannerButton
(
controller:
controller
),
Center
(
child:
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
200
,
height:
50
,
child:
FittedBox
(
child:
Text
(
barcode
?.
barcodes
.
first
.
rawValue
??
'Scan something!'
,
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headlineMedium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
body:
Stack
(
children:
[
MobileScanner
(
controller:
controller
,
errorBuilder:
(
context
,
error
,
child
)
{
return
ScannerErrorWidget
(
error:
error
);
},
fit:
BoxFit
.
contain
,
),
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
100
,
color:
Colors
.
black
.
withOpacity
(
0.4
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
ToggleFlashlightButton
(
controller:
controller
),
StartStopMobileScannerButton
(
controller:
controller
),
Center
(
child:
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
200
,
height:
50
,
child:
FittedBox
(
child:
Text
(
barcode
?.
barcodes
.
first
.
rawValue
??
'Scan something!'
,
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headlineMedium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
SwitchCameraButton
(
controller:
controller
),
AnalyzeImageFromGalleryButton
(
controller:
controller
),
],
),
),
),
SwitchCameraButton
(
controller:
controller
),
AnalyzeImageFromGalleryButton
(
controller:
controller
),
],
),
],
);
},
),
),
],
),
);
}
...
...
Please
register
or
login
to post a comment