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-01-31 07:58:16 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cfd4b1ddd92d2e6001e4b66d7fa426d7a35e65c7
cfd4b1dd
1 parent
7cf225bd
imp: refactor code to latest stable flutter release
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
39 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_window.dart
example/lib/barcode_scanner_without_controller.dart
example/lib/barcode_scanner_zoom.dart
example/lib/barcode_list_scanner_controller.dart
View file @
cfd4b1d
...
...
@@ -28,19 +28,23 @@ class _BarcodeListScannerWithControllerState
bool
isStarted
=
true
;
void
_startOrStop
()
{
if
(
isStarted
)
{
controller
.
stop
();
}
else
{
controller
.
start
().
catchError
((
error
)
{
if
(
mounted
)
{
setState
(()
{});
}
try
{
if
(
isStarted
)
{
controller
.
stop
();
}
else
{
controller
.
start
();
}
setState
(()
{
isStarted
=
!
isStarted
;
});
}
on
Exception
catch
(
e
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
'Something went wrong!
$e
'
),
backgroundColor:
Colors
.
red
,
),
);
}
setState
(()
{
isStarted
=
!
isStarted
;
});
}
@override
...
...
@@ -121,7 +125,7 @@ class _BarcodeListScannerWithControllerState
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headline
4
!
.
headline
Medium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
...
...
example/lib/barcode_scanner_controller.dart
View file @
cfd4b1d
...
...
@@ -28,19 +28,23 @@ class _BarcodeScannerWithControllerState
bool
isStarted
=
true
;
void
_startOrStop
()
{
if
(
isStarted
)
{
controller
.
stop
();
}
else
{
controller
.
start
().
catchError
((
error
)
{
if
(
mounted
)
{
setState
(()
{});
}
try
{
if
(
isStarted
)
{
controller
.
stop
();
}
else
{
controller
.
start
();
}
setState
(()
{
isStarted
=
!
isStarted
;
});
}
on
Exception
catch
(
e
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
'Something went wrong!
$e
'
),
backgroundColor:
Colors
.
red
,
),
);
}
setState
(()
{
isStarted
=
!
isStarted
;
});
}
@override
...
...
@@ -127,7 +131,7 @@ class _BarcodeScannerWithControllerState
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headline
4
!
.
headline
Medium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
...
...
example/lib/barcode_scanner_returning_image.dart
View file @
cfd4b1d
...
...
@@ -30,19 +30,23 @@ class _BarcodeScannerReturningImageState
bool
isStarted
=
true
;
void
_startOrStop
()
{
if
(
isStarted
)
{
controller
.
stop
();
}
else
{
controller
.
start
().
catchError
((
error
)
{
if
(
mounted
)
{
setState
(()
{});
}
try
{
if
(
isStarted
)
{
controller
.
stop
();
}
else
{
controller
.
start
();
}
setState
(()
{
isStarted
=
!
isStarted
;
});
}
on
Exception
catch
(
e
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
'Something went wrong!
$e
'
),
backgroundColor:
Colors
.
red
,
),
);
}
setState
(()
{
isStarted
=
!
isStarted
;
});
}
@override
...
...
@@ -141,7 +145,7 @@ class _BarcodeScannerReturningImageState
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headline
4
!
.
headline
Medium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
...
...
example/lib/barcode_scanner_window.dart
View file @
cfd4b1d
...
...
@@ -82,7 +82,7 @@ class _BarcodeScannerWithScanWindowState
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headline
4
!
.
headline
Medium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
...
...
example/lib/barcode_scanner_without_controller.dart
View file @
cfd4b1d
...
...
@@ -54,7 +54,7 @@ class _BarcodeScannerWithoutControllerState
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headline
4
!
.
headline
Medium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
...
...
example/lib/barcode_scanner_zoom.dart
View file @
cfd4b1d
...
...
@@ -109,7 +109,7 @@ class _BarcodeScannerWithZoomState extends State<BarcodeScannerWithZoom>
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headline
4
!
.
headline
Medium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
...
...
Please
register
or
login
to post a comment