Skip to content

Allow for customizing and theming of extended FAB content padding - #87062

Merged
rami-a merged 5 commits into
flutter:masterfrom
rami-a:extended-fab-spacing
Jul 27, 2021
Merged

rami-a merged 5 commits into
flutter:masterfrom
rami-a:extended-fab-spacing

Conversation

@rami-a

@rami-a rami-a commented Jul 26, 2021 •

Copy link
Copy Markdown
Contributor

This change adds a parameter to the extended FAB constructor (and the FAB theme) to allow for the customization of the content's padding for the extended FAB.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard Bot added p: material_ui material_ui package in flutter/packages framework flutter/packages/flutter repository. See also f: labels. labels Jul 26, 2021
@rami-a
rami-a requested a review from HansMuller July 26, 2021 18:32
@google-cla google-cla Bot added the cla: yes label Jul 26, 2021
@rami-a rami-a changed the title Allow for customizing and theming of extended FAB leading and trailing spacing Allow for customizing and theming of extended FAB content padding Jul 26, 2021

@HansMuller HansMuller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

const Widget width16 = SizedBox(width: 16.0);
final EdgeInsetsGeometry padding = extendedPadding
?? floatingActionButtonTheme.extendedPadding
?? (child != null && isExtended ? const EdgeInsetsDirectional.only(start: 16.0, end: 20.0) : const EdgeInsetsDirectional.only(start: 20.0, end: 20.0));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to put the conditional in the start field, losing 2 consts for 1 non const EdgeInsetsDirectional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

padding: padding,
child: Row(
mainAxisSize: MainAxisSize.min,
children: child == null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be reduced to an array with if conditionals inside

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@rami-a
rami-a merged commit 83a215e into flutter:master Jul 27, 2021
@rami-a
rami-a deleted the extended-fab-spacing branch July 27, 2021 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants