Skip to content

Commit 64064df

Browse files
committed
[camera] Refactor Radio widgets in example
Refactors the camera example to use a new `RadioGroup` widget. This removes deprecated `groupValue` and `onChanged` properties from each individual `RadioListTile` and moves them to the parent `RadioGroup`.
1 parent 32a6914 commit 64064df

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,9 +598,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
598598
width: 90.0,
599599
child: RadioListTile<CameraDescription>(
600600
title: Icon(getCameraLensIcon(cameraDescription.lensDirection)),
601-
groupValue: controller?.description,
602601
value: cameraDescription,
603-
onChanged: onChanged,
604602
),
605603
),
606604
);
@@ -610,7 +608,11 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
610608
return Expanded(
611609
child: SizedBox(
612610
height: 56.0,
613-
child: ListView(scrollDirection: Axis.horizontal, children: toggles),
611+
child: RadioGroup<CameraDescription>(
612+
groupValue: controller?.description,
613+
onChanged: onChanged,
614+
child: ListView(scrollDirection: Axis.horizontal, children: toggles),
615+
),
614616
),
615617
);
616618
}

0 commit comments

Comments
 (0)