Julian Steenbakker

imp: refactor code to latest stable flutter release

... ... @@ -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
.headline4!
.headlineMedium!
.copyWith(color: Colors.white),
),
),
... ...
... ... @@ -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
.headline4!
.headlineMedium!
.copyWith(color: Colors.white),
),
),
... ...
... ... @@ -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
.headline4!
.headlineMedium!
.copyWith(color: Colors.white),
),
),
... ...
... ... @@ -82,7 +82,7 @@ class _BarcodeScannerWithScanWindowState
overflow: TextOverflow.fade,
style: Theme.of(context)
.textTheme
.headline4!
.headlineMedium!
.copyWith(color: Colors.white),
),
),
... ...
... ... @@ -54,7 +54,7 @@ class _BarcodeScannerWithoutControllerState
overflow: TextOverflow.fade,
style: Theme.of(context)
.textTheme
.headline4!
.headlineMedium!
.copyWith(color: Colors.white),
),
),
... ...
... ... @@ -109,7 +109,7 @@ class _BarcodeScannerWithZoomState extends State<BarcodeScannerWithZoom>
overflow: TextOverflow.fade,
style: Theme.of(context)
.textTheme
.headline4!
.headlineMedium!
.copyWith(color: Colors.white),
),
),
... ...