Skip to content

Add alignment configuration to FDialogContentStyle#1071

Open
elrizwiraswara wants to merge 1 commit into
duobaseio:mainfrom
elrizwiraswara:feat/dialog-content-alignment
Open

Add alignment configuration to FDialogContentStyle#1071
elrizwiraswara wants to merge 1 commit into
duobaseio:mainfrom
elrizwiraswara:feat/dialog-content-alignment

Conversation

@elrizwiraswara

Copy link
Copy Markdown
Contributor

Describe the changes

First off, thank you for Forui. I've been using it for several months now and the
experience has been great.

While moving to the latest version, I noticed the dialog styling changed. Most of it can
be adjusted through FThemeData.dialogStyle, but the content's cross-axis (vertical)
alignment cannot. The earlier changelog notes this change:

Breaking Change VerticalContent alignment from center to start.

I personally prefer the previous centered content alignment. Right now the only way to get
it back is a custom FDialog.raw, which is awkward to apply consistently across an entire
app. Being able to set it once on FThemeData.dialogStyle would be much simpler, so this PR
adds that:

  • Add FDialogContentStyle.crossAxisAlignment to control how the image, title, body, and
    actions align along the cross axis.
  • Add FDialogContentStyle.titleTextAlign and FDialogContentStyle.bodyTextAlign to control
    the title/body text alignment.
  • All three default to start, so existing behavior is unchanged (non-breaking).
  • Content now reads these from the style instead of hardcoding them. Because the fields are
    keyed by the dialog's axis variant, horizontal and vertical layouts can be aligned
    independently.

Checklist

  • I have read the CONTRIBUTING.md.
  • I have included the relevant unit/golden tests.
  • I have included the relevant samples.
  • I have updated the documentation accordingly.
  • I have added the required flutters_hook for widget controllers.
  • I have updated the CHANGELOG.md if necessary.

FDialog's content alignment was hardcoded to `start` in the internal
Content hierarchy, so it could not be configured via FThemeData.dialogStyle.
Expose crossAxisAlignment, titleTextAlign, and bodyTextAlign on the style,
all defaulting to `start` to preserve existing behavior.
@Pante

Pante commented Jun 22, 2026

Copy link
Copy Markdown
Member

Thanks for filing a PR, unfortunately I'm putting this PR on hold as we evaluate shifting certain widget's content/layouts to being purely CLI generated instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants