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-10-23 11:42:59 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
10383105d696e2e1c7b0a8e2fad9ae34a7d3873b
10383105
1 parent
bbc9042b
fix redundant cast; bump example to Dart 2.18 so that the check is reported as well
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
53 deletions
example/lib/barcode_list_scanner_controller.dart
example/lib/barcode_scanner_controller.dart
example/lib/barcode_scanner_returning_image.dart
example/lib/barcode_scanner_zoom.dart
example/pubspec.yaml
example/lib/barcode_list_scanner_controller.dart
View file @
1038310
...
...
@@ -82,16 +82,10 @@ class _BarcodeListScannerWithControllerState
children:
[
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
TorchState
>
(
valueListenable:
controller
.
torchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
flash_off
,
color:
Colors
.
grey
,
);
}
switch
(
state
as
TorchState
)
{
switch
(
state
)
{
case
TorchState
.
off
:
return
const
Icon
(
Icons
.
flash_off
,
...
...
@@ -134,13 +128,10 @@ class _BarcodeListScannerWithControllerState
),
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
CameraFacing
>
(
valueListenable:
controller
.
cameraFacingState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
camera_front
);
}
switch
(
state
as
CameraFacing
)
{
switch
(
state
)
{
case
CameraFacing
.
front
:
return
const
Icon
(
Icons
.
camera_front
);
case
CameraFacing
.
back
:
...
...
example/lib/barcode_scanner_controller.dart
View file @
1038310
...
...
@@ -85,16 +85,10 @@ class _BarcodeScannerWithControllerState
}
return
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
TorchState
>
(
valueListenable:
controller
.
torchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
flash_off
,
color:
Colors
.
grey
,
);
}
switch
(
state
as
TorchState
)
{
switch
(
state
)
{
case
TorchState
.
off
:
return
const
Icon
(
Icons
.
flash_off
,
...
...
@@ -140,13 +134,10 @@ class _BarcodeScannerWithControllerState
),
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
CameraFacing
>
(
valueListenable:
controller
.
cameraFacingState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
camera_front
);
}
switch
(
state
as
CameraFacing
)
{
switch
(
state
)
{
case
CameraFacing
.
front
:
return
const
Icon
(
Icons
.
camera_front
);
case
CameraFacing
.
back
:
...
...
example/lib/barcode_scanner_returning_image.dart
View file @
1038310
...
...
@@ -101,16 +101,10 @@ class _BarcodeScannerReturningImageState
children:
[
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
TorchState
>
(
valueListenable:
controller
.
torchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
flash_off
,
color:
Colors
.
grey
,
);
}
switch
(
state
as
TorchState
)
{
switch
(
state
)
{
case
TorchState
.
off
:
return
const
Icon
(
Icons
.
flash_off
,
...
...
@@ -154,13 +148,10 @@ class _BarcodeScannerReturningImageState
),
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
CameraFacing
>
(
valueListenable:
controller
.
cameraFacingState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
camera_front
);
}
switch
(
state
as
CameraFacing
)
{
switch
(
state
)
{
case
CameraFacing
.
front
:
return
const
Icon
(
Icons
.
camera_front
);
case
CameraFacing
.
back
:
...
...
example/lib/barcode_scanner_zoom.dart
View file @
1038310
...
...
@@ -65,16 +65,10 @@ class _BarcodeScannerWithZoomState extends State<BarcodeScannerWithZoom>
children:
[
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
TorchState
>
(
valueListenable:
controller
.
torchState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
flash_off
,
color:
Colors
.
grey
,
);
}
switch
(
state
as
TorchState
)
{
switch
(
state
)
{
case
TorchState
.
off
:
return
const
Icon
(
Icons
.
flash_off
,
...
...
@@ -123,13 +117,10 @@ class _BarcodeScannerWithZoomState extends State<BarcodeScannerWithZoom>
),
IconButton
(
color:
Colors
.
white
,
icon:
ValueListenableBuilder
(
icon:
ValueListenableBuilder
<
CameraFacing
>
(
valueListenable:
controller
.
cameraFacingState
,
builder:
(
context
,
state
,
child
)
{
if
(
state
==
null
)
{
return
const
Icon
(
Icons
.
camera_front
);
}
switch
(
state
as
CameraFacing
)
{
switch
(
state
)
{
case
CameraFacing
.
front
:
return
const
Icon
(
Icons
.
camera_front
);
case
CameraFacing
.
back
:
...
...
example/pubspec.yaml
View file @
1038310
...
...
@@ -6,7 +6,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version
:
0.0.1
environment
:
sdk
:
'
>=2.1
7
.0
<4.0.0'
sdk
:
'
>=2.1
8
.0
<4.0.0'
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
...
...
Please
register
or
login
to post a comment