Update icon color & icon size assignment to align with new Flutter 3.27.0 breaking changes #513
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a proof of concept—I've only tested for my own use case. It's intended as an option that closes #512.
On closer inspection of Flutter 3.27.0's release notes, I saw several mentions of changes to Icons and their properties:
iconSize
andiconColor
defaults forButtonStyleButton
subclasses. flutter/flutter#143501styleFrom
methods flutter/flutter#154821I haven't explored which of these, if any, is relevant, but they gave me an idea. I noticed that flutter_slidable instantiates the SlidableAction
icon
like this (link):Icon(icon);
As a test, I forked flutter_slidable and tried explicitly assigning the color and size like this:
where
foregroundColor
is an existing property, andiconSize
is a property I've added (defaulting to25.0
).This yielded an appearance similar to what I observed before these API changes:
Results
Appearance in Flutter 3.24.5:
Appearance in Flutter 3.27.0 with flutter_slidable v3.1.2:
Appearance in Flutter 3.27.0 with flutter_slidable fork w/ modified icon style assignment approach: