Skip to content

Commit a78aa09

Browse files
committed
fix: build fails due to deprecated member use
fixes: #2845
1 parent 20001d6 commit a78aa09

File tree

5 files changed

+70
-50
lines changed

5 files changed

+70
-50
lines changed

lib/view/multimeter_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class _MultimeterScreenState extends State<MultimeterScreen> {
143143
Transform.scale(
144144
scale: 0.75,
145145
child: Switch(
146-
activeColor:
146+
activeThumbColor:
147147
multimeterBorderBlack,
148148
value: provider.isSwitchChecked,
149149
onChanged: (bool value) {},

lib/view/settings_screen.dart

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
4242
style:
4343
const TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
4444
children: [
45-
RadioListTile<bool>(
46-
title: Text(appLocalizations.txtFormat),
47-
value: true,
45+
RadioGroup(
4846
groupValue: isTxtFormatSelected,
49-
activeColor: primaryRed,
5047
onChanged: (bool? value) {
5148
setState(
5249
() {
@@ -58,12 +55,13 @@ class _SettingsScreenState extends State<SettingsScreen> {
5855
},
5956
);
6057
},
58+
child: RadioListTile<bool>(
59+
title: Text(appLocalizations.txtFormat),
60+
value: true,
61+
activeColor: primaryRed),
6162
),
62-
RadioListTile<bool>(
63-
title: Text(appLocalizations.csvFormat),
64-
value: true,
63+
RadioGroup(
6564
groupValue: isCsvFormatSelected,
66-
activeColor: primaryRed,
6765
onChanged: (bool? value) {
6866
setState(
6967
() {
@@ -75,6 +73,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
7573
},
7674
);
7775
},
76+
child: RadioListTile<bool>(
77+
title: Text(appLocalizations.csvFormat),
78+
value: true,
79+
activeColor: primaryRed,
80+
),
7881
),
7982
Align(
8083
alignment: Alignment.bottomRight,

lib/view/widgets/channel_parameters_widget.dart

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,9 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
243243
mainAxisSize: MainAxisSize.min,
244244
crossAxisAlignment: CrossAxisAlignment.center,
245245
children: [
246-
Radio<bool>(
247-
activeColor: radioButtonActiveColor,
248-
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
249-
value: true,
246+
RadioGroup(
250247
groupValue:
251248
oscilloscopeStateProvider.isInBuiltMICSelected,
252-
toggleable: true,
253249
onChanged: (bool? value) {
254250
setState(
255251
() {
@@ -276,6 +272,12 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
276272
},
277273
);
278274
},
275+
child: Radio<bool>(
276+
activeColor: radioButtonActiveColor,
277+
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
278+
value: true,
279+
toggleable: true,
280+
),
279281
),
280282
Text(
281283
appLocalizations.inBuiltMic,
@@ -286,12 +288,8 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
286288
fontStyle: FontStyle.normal,
287289
),
288290
),
289-
Radio<bool>(
290-
activeColor: radioButtonActiveColor,
291-
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
292-
value: true,
291+
RadioGroup(
293292
groupValue: oscilloscopeStateProvider.isMICSelected,
294-
toggleable: true,
295293
onChanged: (bool? value) {
296294
setState(
297295
() {
@@ -309,6 +307,12 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
309307
},
310308
);
311309
},
310+
child: Radio<bool>(
311+
activeColor: radioButtonActiveColor,
312+
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
313+
value: true,
314+
toggleable: true,
315+
),
312316
),
313317
Text(
314318
appLocalizations.pslabMic,

lib/view/widgets/config_widgets.dart

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,20 @@ class ConfigDropdownItem extends StatelessWidget {
155155
content: Column(
156156
mainAxisSize: MainAxisSize.min,
157157
children: options.map((option) {
158-
return RadioListTile<String>(
159-
title: Text(option.displayName),
160-
value: option.value,
161-
groupValue: selectedValue,
162-
onChanged: (String? value) {
163-
if (value != null) {
164-
onChanged(value);
165-
Navigator.of(context).pop();
166-
}
167-
},
168-
activeColor: primaryRed,
169-
contentPadding: EdgeInsets.zero,
170-
);
158+
return RadioGroup(
159+
groupValue: selectedValue,
160+
onChanged: (String? value) {
161+
if (value != null) {
162+
onChanged(value);
163+
Navigator.of(context).pop();
164+
}
165+
},
166+
child: RadioListTile<String>(
167+
title: Text(option.displayName),
168+
value: option.value,
169+
activeColor: primaryRed,
170+
contentPadding: EdgeInsets.zero,
171+
));
171172
}).toList(),
172173
),
173174
actions: [

lib/view/widgets/robotic_arm_controls.dart

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,15 @@ class _RoboticArmControlsState extends State<RoboticArmControls> {
178178
child: Row(
179179
mainAxisAlignment: MainAxisAlignment.center,
180180
children: [
181-
Radio<String>(
182-
value: appLocalizations.duration1Min,
181+
RadioGroup(
183182
groupValue: provider.selectedDuration,
184-
activeColor: primaryRed,
185183
onChanged: (value) {
186184
provider.setSelectedDuration(value!);
187185
},
186+
child: Radio<String>(
187+
value: appLocalizations.duration1Min,
188+
activeColor: primaryRed,
189+
),
188190
),
189191
Text(
190192
appLocalizations.duration1Min,
@@ -198,13 +200,15 @@ class _RoboticArmControlsState extends State<RoboticArmControls> {
198200
child: Row(
199201
mainAxisAlignment: MainAxisAlignment.center,
200202
children: [
201-
Radio<String>(
202-
value: appLocalizations.duration2Min,
203+
RadioGroup(
203204
groupValue: provider.selectedDuration,
204-
activeColor: primaryRed,
205205
onChanged: (value) {
206206
provider.setSelectedDuration(value!);
207207
},
208+
child: Radio<String>(
209+
value: appLocalizations.duration2Min,
210+
activeColor: primaryRed,
211+
),
208212
),
209213
Text(
210214
appLocalizations.duration2Min,
@@ -358,10 +362,8 @@ class _RoboticArmControlsState extends State<RoboticArmControls> {
358362
child: Row(
359363
mainAxisAlignment: MainAxisAlignment.center,
360364
children: [
361-
Radio<String>(
362-
value: appLocalizations.frequency50Hz,
365+
RadioGroup(
363366
groupValue: provider.selectedFrequency,
364-
activeColor: primaryRed,
365367
onChanged: (value) {
366368
if (provider.isPlaying) {
367369
ScaffoldMessenger.of(context).showSnackBar(
@@ -377,17 +379,19 @@ class _RoboticArmControlsState extends State<RoboticArmControls> {
377379
}
378380
provider.setSelectedFrequency(value!);
379381
},
382+
child: Radio<String>(
383+
value: appLocalizations.frequency50Hz,
384+
activeColor: primaryRed,
385+
),
380386
),
381387
Text(
382388
appLocalizations.frequency50Hz,
383389
style: const TextStyle(
384390
color: Colors.black, fontSize: 12),
385391
),
386392
const SizedBox(width: 16),
387-
Radio<String>(
388-
value: appLocalizations.frequency100Hz,
393+
RadioGroup(
389394
groupValue: provider.selectedFrequency,
390-
activeColor: primaryRed,
391395
onChanged: (value) {
392396
if (provider.isPlaying) {
393397
ScaffoldMessenger.of(context).showSnackBar(
@@ -403,6 +407,10 @@ class _RoboticArmControlsState extends State<RoboticArmControls> {
403407
}
404408
provider.setSelectedFrequency(value!);
405409
},
410+
child: Radio<String>(
411+
value: appLocalizations.frequency100Hz,
412+
activeColor: primaryRed,
413+
),
406414
),
407415
Text(
408416
appLocalizations.frequency100Hz,
@@ -449,26 +457,30 @@ class _RoboticArmControlsState extends State<RoboticArmControls> {
449457
child: Row(
450458
mainAxisAlignment: MainAxisAlignment.center,
451459
children: [
452-
Radio<String>(
453-
value: appLocalizations.angle180,
460+
RadioGroup(
454461
groupValue: provider.selectedMaxAngle,
455-
activeColor: primaryRed,
456462
onChanged: (value) {
457463
provider.setSelectedMaxAngle(value!);
458464
},
465+
child: Radio<String>(
466+
value: appLocalizations.angle180,
467+
activeColor: primaryRed,
468+
),
459469
),
460470
Text(
461471
appLocalizations.angle180,
462472
style: TextStyle(color: Colors.black, fontSize: 12),
463473
),
464474
const SizedBox(width: 16),
465-
Radio<String>(
466-
value: appLocalizations.angle360,
475+
RadioGroup(
467476
groupValue: provider.selectedMaxAngle,
468-
activeColor: primaryRed,
469477
onChanged: (value) {
470478
provider.setSelectedMaxAngle(value!);
471479
},
480+
child: Radio<String>(
481+
value: appLocalizations.angle360,
482+
activeColor: primaryRed,
483+
),
472484
),
473485
Text(
474486
appLocalizations.angle360,

0 commit comments

Comments
 (0)