Skip to content

Commit 157a932

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 64064df commit 157a932

File tree

1 file changed

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

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,16 +599,18 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
599599
width: 90.0,
600600
child: RadioListTile<CameraDescription>(
601601
title: Icon(getCameraLensIcon(cameraDescription.lensDirection)),
602-
groupValue: controller?.description,
603602
value: cameraDescription,
604-
onChanged: onChanged,
605603
),
606604
),
607605
);
608606
}
609607
}
610608

611-
return Row(children: toggles);
609+
return RadioGroup<CameraDescription>(
610+
groupValue: controller?.description,
611+
onChanged: onChanged,
612+
child: Row(children: toggles),
613+
);
612614
}
613615

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

0 commit comments

Comments
 (0)