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
2023-07-31 21:50:02 +0200
Browse Files
Options
Browse Files
Download
Plain Diff
Committed by
GitHub
2023-07-31 21:50:02 +0200
Commit
b5aeef8e64d4b8f6e4c1014695f0946e9aa58a3a
b5aeef8e
2 parents
c6cf6c7d
7f17b4e7
Merge pull request #671 from svenopdehipt/overlay
feat: Add overlay to scanner
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
lib/src/mobile_scanner.dart
lib/src/mobile_scanner.dart
View file @
b5aeef8
...
...
@@ -62,6 +62,10 @@ class MobileScanner extends StatefulWidget {
/// Default: false
final
bool
startDelay
;
/// The overlay which will be painted above the scanner when has started successful.
/// Will no be pointed when an error occurs or the scanner hasn't be started yet.
final
Widget
?
overlay
;
/// Create a new [MobileScanner] using the provided [controller]
/// and [onBarcodeDetected] callback.
const
MobileScanner
({
...
...
@@ -74,6 +78,7 @@ class MobileScanner extends StatefulWidget {
this
.
placeholderBuilder
,
this
.
scanWindow
,
this
.
startDelay
=
false
,
this
.
overlay
,
super
.
key
,
});
...
...
@@ -251,15 +256,19 @@ class _MobileScannerState extends State<MobileScanner>
_controller
.
updateScanWindow
(
scanWindow
);
}
return
ClipRect
(
return
Stack
(
alignment:
Alignment
.
center
,
children:
[
ClipRect
(
child:
LayoutBuilder
(
builder:
(
_
,
constraints
)
{
return
SizedBox
.
fromSize
(
size:
constraints
.
biggest
,
child:
FittedBox
(
fit:
widget
.
fit
,
child:
SizedBox
.
fromSize
(
size:
value
.
size
,
child:
SizedBox
(
width:
value
.
size
.
width
,
height:
value
.
size
.
height
,
child:
kIsWeb
?
HtmlElementView
(
viewType:
value
.
webId
!)
:
Texture
(
textureId:
value
.
textureId
!),
...
...
@@ -268,6 +277,10 @@ class _MobileScannerState extends State<MobileScanner>
);
},
),
),
if
(
widget
.
overlay
!=
null
)
widget
.
overlay
!
],
);
},
);
...
...
Please
register
or
login
to post a comment