Skip to content

Commit 8109fb3

Browse files
committed
[camera_android_camerax] Refactor Radio widgets in example
Refactors the `camera_android_camerax` example to use a new `RadioGroup` widget. This removes the deprecated `groupValue` and `onChanged` properties from each individual `RadioListTile` and moves them to the parent `RadioGroup`.
1 parent 157a932 commit 8109fb3

File tree

1 file changed

+5
-3
lines changed
  • packages/camera/camera_android_camerax/example/lib

1 file changed

+5
-3
lines changed

packages/camera/camera_android_camerax/example/lib/main.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,16 +609,18 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
609609
width: 90.0,
610610
child: RadioListTile<CameraDescription>(
611611
title: Icon(getCameraLensIcon(cameraDescription.lensDirection)),
612-
groupValue: controller?.description,
613612
value: cameraDescription,
614-
onChanged: onChanged,
615613
),
616614
),
617615
);
618616
}
619617
}
620618

621-
return Row(children: toggles);
619+
return RadioGroup<CameraDescription>(
620+
groupValue: controller?.description,
621+
onChanged: onChanged,
622+
child: Row(children: toggles),
623+
);
622624
}
623625

624626
String timestamp() => DateTime.now().millisecondsSinceEpoch.toString();

0 commit comments

Comments
 (0)