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
Tobias Marschall
2022-08-01 13:14:57 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2022-08-01 13:14:57 +0200
Commit
a92ba813ba32d0a67f3ad2f169a47f7f00b5a362
a92ba813
1 parent
57c9a07d
remove unused layout builder (#211)
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
35 deletions
lib/src/mobile_scanner.dart
lib/src/mobile_scanner.dart
View file @
a92ba81
...
...
@@ -70,44 +70,40 @@ class _MobileScannerState extends State<MobileScanner>
@override
Widget
build
(
BuildContext
context
)
{
return
LayoutBuilder
(
builder:
(
context
,
BoxConstraints
constraints
)
{
return
ValueListenableBuilder
(
valueListenable:
controller
.
args
,
builder:
(
context
,
value
,
child
)
{
value
=
value
as
MobileScannerArguments
?;
if
(
value
==
null
)
{
return
Container
(
color:
Colors
.
black
);
return
ValueListenableBuilder
(
valueListenable:
controller
.
args
,
builder:
(
context
,
value
,
child
)
{
value
=
value
as
MobileScannerArguments
?;
if
(
value
==
null
)
{
return
Container
(
color:
Colors
.
black
);
}
else
{
controller
.
barcodes
.
listen
((
barcode
)
{
if
(!
widget
.
allowDuplicates
)
{
if
(
lastScanned
!=
barcode
.
rawValue
)
{
lastScanned
=
barcode
.
rawValue
;
widget
.
onDetect
(
barcode
,
value
!
as
MobileScannerArguments
);
}
}
else
{
controller
.
barcodes
.
listen
((
barcode
)
{
if
(!
widget
.
allowDuplicates
)
{
if
(
lastScanned
!=
barcode
.
rawValue
)
{
lastScanned
=
barcode
.
rawValue
;
widget
.
onDetect
(
barcode
,
value
!
as
MobileScannerArguments
);
}
}
else
{
widget
.
onDetect
(
barcode
,
value
!
as
MobileScannerArguments
);
}
});
return
ClipRect
(
widget
.
onDetect
(
barcode
,
value
!
as
MobileScannerArguments
);
}
});
return
ClipRect
(
child:
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
FittedBox
(
fit:
widget
.
fit
,
child:
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
,
height:
MediaQuery
.
of
(
context
).
size
.
height
,
child:
FittedBox
(
fit:
widget
.
fit
,
child:
SizedBox
(
width:
value
.
size
.
width
,
height:
value
.
size
.
height
,
child:
kIsWeb
?
HtmlElementView
(
viewType:
value
.
webId
!)
:
Texture
(
textureId:
value
.
textureId
!),
),
),
width:
value
.
size
.
width
,
height:
value
.
size
.
height
,
child:
kIsWeb
?
HtmlElementView
(
viewType:
value
.
webId
!)
:
Texture
(
textureId:
value
.
textureId
!),
),
);
}
},
);
),
),
);
}
},
);
}
...
...
Please
register
or
login
to post a comment