Skip to content

Conversation

@QuncCccccc
Copy link
Contributor

@QuncCccccc QuncCccccc commented Mar 3, 2023

Fixes #111800

This PR is to add IconButton.filled, IconButton.tilledTonal and IconButton.outlined constructors.

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 this PR is [test-exempt].
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Mar 3, 2023
@QuncCccccc QuncCccccc changed the title Icon button factories Add IconButton.filled, IconButton.filledTonal, IconButton.outlined Mar 3, 2023
@QuncCccccc QuncCccccc changed the title Add IconButton.filled, IconButton.filledTonal, IconButton.outlined Add IconButton.filled, IconButton.filledTonal, IconButton.outlined Mar 3, 2023
@QuncCccccc QuncCccccc marked this pull request as ready for review March 3, 2023 18:31
@QuncCccccc QuncCccccc requested a review from HansMuller March 3, 2023 18:31
@QuncCccccc QuncCccccc force-pushed the icon_button_fatories branch from 64dae0a to c1c730f Compare March 3, 2023 21:19
@QuncCccccc QuncCccccc force-pushed the icon_button_fatories branch from c1c730f to e2db475 Compare March 3, 2023 23:08
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

Nicely done. LGTM

});
},
),
const SizedBox(width: 10,),
Copy link
Contributor

Choose a reason for hiding this comment

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

In cases like this we don't usually include the trailing comma:

Suggested change
const SizedBox(width: 10,),
const SizedBox(width: 10),

Here and elsewhere.

@override
ButtonStyle defaultStyleOf(BuildContext context) {
return _IconButtonDefaultsM3(context);
switch (variant) {
Copy link
Contributor

Choose a reason for hiding this comment

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

NICE

@rydmike
Copy link
Contributor

rydmike commented Mar 7, 2023

@QuncCccccc and @HansMuller, this PR is very nice, love it! However, and sadly based on my tests, it brings the same challenge to theming the IconButton as we already have with the FilledButton here. If we theme the buttons foreground or background colors, we destroy the variants, as they all become the same, since they share the same theme.

A solution to this, with variant themes, is discussed in the related FAB issue here

I will open a separate issue later for this case and reference this comment and other related issues.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add factory constructors for filled, tonal, outlined icon buttons

3 participants