Navaron Bracke

fix redundant cast; bump example to Dart 2.18 so that the check is reported as well

... ... @@ -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:
... ...
... ... @@ -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:
... ...
... ... @@ -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:
... ...
... ... @@ -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:
... ...
... ... @@ -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.17.0 <4.0.0'
sdk: '>=2.18.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
... ...