Repository navigation
feat(mix): accept transform in gradient shorthands - #1073
Merged
Merged
Conversation
leoafarias
changed the base branch from
main
to
fix/animation-config-removal
September 29, 2026 04:13
leoafarias
force-pushed
the
feat/gradient-shorthand-transform
branch
from
September 29, 2026 04:13
28b84b4 to
ca765d2
Compare
leoafarias
added this pull request to stack #1075
September 29, 2026 04:13
3 of 4 tasks
tilucasoli
force-pushed
the
feat/gradient-shorthand-transform
branch
2 times, most recently
from
September 29, 2026 13:20
5ec5473 to
0430023
Compare
leoafarias
force-pushed
the
feat/gradient-shorthand-transform
branch
from
September 29, 2026 15:36
0430023 to
a7bc0a4
Compare
1 of 4 tasks
tilucasoli
force-pushed
the
feat/gradient-shorthand-transform
branch
2 times, most recently
from
October 1, 2026 02:57
f28c871 to
c3b0186
Compare
linearGradient, radialGradient, sweepGradient and their foreground counterparts now take an optional GradientTransform, forwarded to the underlying LinearGradientMix/RadialGradientMix/SweepGradientMix. Rotating a gradient (for example GradientRotation driven by a keyframe track) no longer requires dropping to gradient(SweepGradientMix(...)). The generated BoxStyler, FlexBoxStyler, StackBoxStyler and WrapBoxStyler factories pick up the parameter via regeneration.
tilucasoli
force-pushed
the
feat/gradient-shorthand-transform
branch
from
October 1, 2026 03:09
c3b0186 to
050b72b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
linearGradient,radialGradient,sweepGradientand the threeforeground*Gradientshorthands onDecorationStyleMixinnow take an optionalGradientTransform? transform. It is passed straight to the matchingLinearGradientMix,RadialGradientMixorSweepGradientMix. The generatedBoxStyler,FlexBoxStyler,StackBoxStylerandWrapBoxStylerfactories were regenerated and forward it too.Before, spinning a gradient (for example a
GradientRotationdriven by a keyframe track) meant dropping togradient(SweepGradientMix(...)), even though every gradient Mix type already supportstransform.Why extend the shorthand instead of deprecating it
skills/mix/references/styler-api-policy.md. They are grouped, nullable-argument conveniences, which the policy keeps.stopsandtileMode.transformwas the only gradient field they did not expose, so this change makes them complete rather than adding a new kind of API.Changes
decoration_style_mixin.dart: addstransformto all six gradient shorthands, with doc notes.*_spec.g.dartfactories for Box, FlexBox, StackBox and WrapBox.box_style_factory_test.dart: each shorthand resolves with the given transform; the result equals the explicitgradient(...Mix(transform: ...))form; static factories match the instance methods; omittingtransformleaves it null.skills/mix/references/fluent-api.mdtable, and a "Spinning a gradient" keyframe example inanimations.md. The example was checked with a temporary widget test that was not committed.Unreleasedentry.Additive and non-breaking: existing calls are unchanged.
Validation
fvm flutter testinpackages/mix: 2986 tests passedfvm dart analyze packages/mix: no errors or warnings. The 7prefer_initializing_formalsinfos are all in files this PR does not touch.dart format: clean