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
p-mazhnik
2022-12-08 14:33:17 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
22d502b47bfb010094539079c840723b9e02c5b6
22d502b4
1 parent
96ddf1ca
fix linter issue
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
30 deletions
example/lib/barcode_scanner_controller.dart
example/lib/barcode_scanner_controller.dart
View file @
22d502b
...
...
@@ -78,40 +78,41 @@ class _BarcodeScannerWithControllerState
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
ValueListenableBuilder
(
valueListenable:
controller
.
hasTorchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
!=
true
)
{
return
const
SizedBox
.
shrink
();
}
return
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
valueListenable:
controller
.
torchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
valueListenable:
controller
.
hasTorchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
!=
true
)
{
return
const
SizedBox
.
shrink
();
}
return
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
valueListenable:
controller
.
torchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
flash_off
,
color:
Colors
.
grey
,
);
}
switch
(
state
as
TorchState
)
{
case
TorchState
.
off
:
return
const
Icon
(
Icons
.
flash_off
,
color:
Colors
.
grey
,
);
}
switch
(
state
as
TorchState
)
{
case
TorchState
.
off
:
return
const
Icon
(
Icons
.
flash_off
,
color:
Colors
.
grey
,
);
case
TorchState
.
on
:
return
const
Icon
(
Icons
.
flash_on
,
color:
Colors
.
yellow
,
);
}
},
),
iconSize:
32.0
,
onPressed:
()
=>
controller
.
toggleTorch
(),
);
}),
case
TorchState
.
on
:
return
const
Icon
(
Icons
.
flash_on
,
color:
Colors
.
yellow
,
);
}
},
),
iconSize:
32.0
,
onPressed:
()
=>
controller
.
toggleTorch
(),
);
},
),
IconButton
(
color:
Colors
.
white
,
icon:
isStarted
...
...
Please
register
or
login
to post a comment