Skip to content

Commit 6c5c615

Browse files
committed
[google_sign_in_web] Disable RadioListTile when onChanged is null
Disables the `RadioListTile` widgets in the example when their `onChanged` callback is null. This provides a visual indication that the options are not selectable. The change also simplifies the `onChanged` handler logic within the `RadioGroup`.
1 parent 7b2347e commit 6c5c615

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/google_sign_in/google_sign_in_web/example/lib/src/button_configuration_column.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,12 @@ Widget _renderRadioListTileCard<T extends Enum>({
169169
T? selected,
170170
void Function(T?)? onChanged,
171171
}) {
172-
final void Function(T?) handleChange = onChanged ?? (_) {};
173-
174172
return _renderConfigCard(
175173
title: title,
176174
children: <Widget>[
177175
RadioGroup<T>(
178176
groupValue: selected,
179-
onChanged: (T? v) => handleChange(v),
177+
onChanged: (T? v) => (onChanged ?? (_) {})(v),
180178
child: Column(
181179
mainAxisSize: MainAxisSize.min,
182180
children:
@@ -186,6 +184,7 @@ Widget _renderRadioListTileCard<T extends Enum>({
186184
value: value,
187185
selected: value == selected,
188186
title: Text(value.name),
187+
enabled: onChanged != null,
189188
dense: true,
190189
),
191190
)

0 commit comments

Comments
 (0)