Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GrouptedRadio and GroupedCheckbox]: The final cell construction is different so one is probably wrong. #1345

Closed
1 task done
freemansoft opened this issue Dec 28, 2023 · 0 comments · Fixed by #1346
Closed
1 task done
Labels
enhancement New feature or request

Comments

@freemansoft
Copy link
Contributor

freemansoft commented Dec 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Package/Plugin version

9.1.0

What you'd like to happen

Make RadioGroup and CheckboxGroup layout patterns the same.

The final cell rendering for GroupedRadio and GroupedCheckbox are different with slightly different separator behavior for no reason. They should be synced up.

  1. The radio is a Column(child: Row(child: ...)) with a mainAxisSize and crossAxisAlignment set
  2. The checkbox is Row(child: ...)

Symptoms

Someone added the feature to RadioGroup in PR #1106.

RadioGroup

Supports the separator if the orientation is vertical or horizontal. Has vertical and !vertical handlers to tune the position in either the Row or in the Column.

CheckboxGroup

Adds a separator in the row ignoring the group's orientation because there is no Column to put it in.

Alternatives you've considered

  1. Submit pull requests to align the behavior

I can do the PR if someone picks an option.

Options

  1. align on GroupedCheckbox.
    1. Essentially back out PR 1106
  2. align on GroupedRadio.
    1. Apply the changes to GroupedCheckbox that were applied to GroupedRadio in PR 1106

Aditional information

GroupedCheckbox

return Row(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        if (controlAffinity == ControlAffinity.leading) control,
        Flexible(flex: 1, child: label),
        if (controlAffinity == ControlAffinity.trailing) control,
        if (separator != null && index != options.length - 1) separator!,
      ],
    );

GroupedRadio

return Column(
      mainAxisSize: MainAxisSize.min,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            if (widget.controlAffinity == ControlAffinity.leading) control,
            Flexible(child: label),
            if (widget.controlAffinity == ControlAffinity.trailing) control,
            if (widget.orientation != OptionsOrientation.vertical &&
                widget.separator != null &&
                index != widget.options.length - 1)
              widget.separator!,
          ],
        ),
        if (widget.orientation == OptionsOrientation.vertical &&
            widget.separator != null &&
            index != widget.options.length - 1)
          widget.separator!,
      ],
    );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
1 participant