Skip to content

Commit f3ed535

Browse files
committed
Use RadioGroup for groupValue and onChanged
1 parent 58c02e0 commit f3ed535

File tree

33 files changed

+195
-211
lines changed

33 files changed

+195
-211
lines changed

packages/animations/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## NEXT
22

3-
* Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
3+
* Uses `RadioGroup` for `groupValue` and `onChanged`.
4+
* Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.
45

56
## 2.0.11
67

packages/animations/example/lib/shared_axis_transition.dart

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,34 +76,28 @@ class _SharedAxisTransitionDemoState extends State<SharedAxisTransitionDemo> {
7676
),
7777
),
7878
const Divider(thickness: 2.0),
79-
Row(
80-
mainAxisAlignment: MainAxisAlignment.center,
81-
children: <Widget>[
82-
Radio<SharedAxisTransitionType>(
83-
value: SharedAxisTransitionType.horizontal,
84-
groupValue: _transitionType,
85-
onChanged: (SharedAxisTransitionType? newValue) {
86-
_updateTransitionType(newValue);
87-
},
88-
),
89-
const Text('X'),
90-
Radio<SharedAxisTransitionType>(
91-
value: SharedAxisTransitionType.vertical,
92-
groupValue: _transitionType,
93-
onChanged: (SharedAxisTransitionType? newValue) {
94-
_updateTransitionType(newValue);
95-
},
96-
),
97-
const Text('Y'),
98-
Radio<SharedAxisTransitionType>(
99-
value: SharedAxisTransitionType.scaled,
100-
groupValue: _transitionType,
101-
onChanged: (SharedAxisTransitionType? newValue) {
102-
_updateTransitionType(newValue);
103-
},
104-
),
105-
const Text('Z'),
106-
],
79+
RadioGroup<SharedAxisTransitionType>(
80+
groupValue: _transitionType,
81+
onChanged: (SharedAxisTransitionType? newValue) {
82+
_updateTransitionType(newValue);
83+
},
84+
child: const Row(
85+
mainAxisAlignment: MainAxisAlignment.center,
86+
children: <Widget>[
87+
Radio<SharedAxisTransitionType>(
88+
value: SharedAxisTransitionType.horizontal,
89+
),
90+
Text('X'),
91+
Radio<SharedAxisTransitionType>(
92+
value: SharedAxisTransitionType.vertical,
93+
),
94+
Text('Y'),
95+
Radio<SharedAxisTransitionType>(
96+
value: SharedAxisTransitionType.scaled,
97+
),
98+
Text('Z'),
99+
],
100+
),
107101
),
108102
],
109103
),

packages/animations/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ publish_to: none
66
version: 0.0.1
77

88
environment:
9-
sdk: ^3.7.0
10-
flutter: ">=3.29.0"
9+
sdk: ^3.9.0
10+
flutter: ">=3.35.0"
1111

1212
dependencies:
1313
animations:

packages/animations/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
55
version: 2.0.11
66

77
environment:
8-
sdk: ^3.7.0
9-
flutter: ">=3.29.0"
8+
sdk: ^3.9.0
9+
flutter: ">=3.35.0"
1010

1111
dependencies:
1212
flutter:

packages/camera/camera/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 0.11.2+1
22

3-
* Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
3+
* Uses `RadioGroup` for `groupValue` and `onChanged`.
4+
* Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.
45

56
## 0.11.2
67

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
}

packages/camera/camera/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ description: Demonstrates how to use the camera plugin.
33
publish_to: none
44

55
environment:
6-
sdk: ^3.7.0
7-
flutter: ">=3.29.0"
6+
sdk: ^3.9.0
7+
flutter: ">=3.35.0"
88

99
dependencies:
1010
camera:

packages/camera/camera/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ description: A Flutter plugin for controlling the camera. Supports previewing
44
Dart.
55
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera
66
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22
7-
version: 0.11.2
7+
version: 0.11.2+1
88

99
environment:
10-
sdk: ^3.7.0
11-
flutter: ">=3.29.0"
10+
sdk: ^3.9.0
11+
flutter: ">=3.35.0"
1212

1313
flutter:
1414
plugin:

packages/camera/camera_android/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 0.10.10+6
22

3-
* Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
3+
* Uses `RadioGroup` for `groupValue` and `onChanged`.
4+
* Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.
45

56
## 0.10.10+5
67

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,16 +619,18 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
619619
width: 90.0,
620620
child: RadioListTile<CameraDescription>(
621621
title: Icon(getCameraLensIcon(cameraDescription.lensDirection)),
622-
groupValue: controller?.description,
623622
value: cameraDescription,
624-
onChanged: onChanged,
625623
),
626624
),
627625
);
628626
}
629627
}
630628

631-
return Row(children: toggles);
629+
return RadioGroup<CameraDescription>(
630+
groupValue: controller?.description,
631+
onChanged: onChanged,
632+
child: Row(children: toggles),
633+
);
632634
}
633635

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

0 commit comments

Comments
 (0)