Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Bug fixes

* Fix ink ripples and hover highlights not covering the whole `Container` when both `ink=True` and `animate` are set, and its `padding` being applied twice. In that combination `padding` and `alignment` were passed to the outer `AnimatedContainer` *and* to the inner `Container` that wraps the content inside the `InkWell`, so a `padding=10` container was laid out with 20 on each side. The duplicated `alignment` was the more visible half: it made the `Material`/`InkWell` shrink-wrap to the content, so splashes and the hover overlay stopped short of the container's edges while `bgcolor` on the same container still filled it - the two disagreed on where the control ended. Both properties now live only on the inner container, which becomes an `AnimatedContainer` when `animate` is set so that padding and alignment changes still animate; this is what the non-animated ink path already did. Inked, animated containers with padding will render tighter than before - by the padding they declare, instead of double by @FeodorFitsner.
* Fix `disabled=True` having almost no effect on `Radio` and `CupertinoRadio`: the radio could still be selected and kept its enabled colors; only the label grayed out. Broken since the migration to Flutter's native `RadioGroup` widget ([#5651](https://github.com/flet-dev/flet/pull/5651)), whose API needs an explicit `enabled: false` that Flet never passed. A disabled radio now ignores clicks and renders grayed out (`fill_color`'s `ControlState.DISABLED` value applies too), disabling a whole `RadioGroup` cascades to its radios, and the label grays out with the default text style as well ([#6159](https://github.com/flet-dev/flet/issues/6159)) by @ndonkoHenri.

## 0.86.5

Expand Down
1 change: 1 addition & 0 deletions packages/flet/lib/src/controls/cupertino_radio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class _CupertinoRadioControlState extends State<CupertinoRadioControl>
var value = widget.control.getString("value", "")!;

var cupertinoRadio = CupertinoRadio<String>(
enabled: !widget.control.disabled,
autofocus: widget.control.getBool("autofocus", false)!,
focusNode: _focusNode,
value: value,
Expand Down
6 changes: 4 additions & 2 deletions packages/flet/lib/src/controls/radio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ class _RadioControlState extends State<RadioControl> {
widget.control.getLabelPosition("label_position", LabelPosition.right)!;
var labelStyle =
widget.control.getTextStyle("label_style", Theme.of(context));
if (widget.control.disabled && labelStyle != null) {
labelStyle = labelStyle.apply(color: Theme.of(context).disabledColor);
if (widget.control.disabled) {
labelStyle = (labelStyle ?? const TextStyle())
.apply(color: Theme.of(context).disabledColor);
}

var radio = Radio<String>(
enabled: !widget.control.disabled,
autofocus: widget.control.getBool("autofocus", false)!,
focusNode: _focusNode,
mouseCursor: widget.control.getMouseCursor("mouse_cursor"),
Expand Down
Loading