NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #1685 most downloaded on pub.dev
Annotations for mix and mix_generator
Last release 15 days ago
23 Sep 2026
Release timing varies
gaps range from 9 days to 7 months
Nearly every release is documented
notes for 15 of 15 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
19 releases · first in 2024
Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com
Co-authored-by: Claude Opus 5 (1M context) noreply@anthropic.com
Stable release of the 2.2.0 line. Cumulative since 2.1.3:
MixWidget.target for plain widget constructor tear-offs and
factoryParameters for independent recipe parameter curation.MixableField.forwardStyler and stylerSurface for opt-in
projection of a nested generated Styler's canonical named-factory surface
onto its parent Styler (#983).stylerFieldNames is reserved as a source field name
and $stylerFieldNames as a generated member name, and that a custom props
implementation must preserve the complete generated field surface (#1028).setterType combined with forwardStyler.Stable release of the 2.2.0 line, cumulative over the 2.2.0-beta.0 through 2.2.0-beta.6 prereleases. This release adds the GridBox and WrapBox layout families, a typed and extensible context-variant system with focus-visible support, a fuller Pressable input and semantics surface, and complete WidgetModifierConfig convenience APIs; it fixes variant merge priority and nested widget-state discovery, and it carries breaking changes to Pressable and to GridBox implicit rows.
GridBox: Added the public GridTrack , GridBoxSpec , GridBoxStyler , and GridBox API with fixed/fractional tracks, explicit and repeated rows, gaps, row-major placement, clipping, and local Breakpoint -based constraint branches. Equal fractional columns use equalColumns ; numeric tracks and gaps support Mix tokens; compatible geometry participates in implicit style animation. GridTrack.auto() adds content-sized row tracks for rows and autoRows : an auto row sizes to its tallest child's natural height at the resolved column width, then stretches shorter children to fill the row. auto is vertical-only; columns rejects it.
WrapBox: Added the public WrapSpec , WrapStyler , WrapBoxSpec , WrapBoxStyler , and WrapBox family with flattened fluent Wrap styling, collision-safe Box/Wrap names, generated constructors and factories, and a runnable gallery example.
Complete WidgetModifierConfig convenience APIs: mouseCursor and scrollView are now available as factories and chain methods, and skew , defaultIcon , iconTheme , box , and reset gained the chain methods their factories were missing. Every built-in modifier can now be reached without .modifier(SomeModifierMix(...)) , for example BoxStyler().wrap(.mouseCursor(SystemMouseCursors.click)) . The chained reset() clears the modifiers accumulated in that configuration only; use the WidgetModifierConfig.reset() factory when the reset must also clear the configuration it is merged into.
ContextVariant.widgetStateDependencies : Context variants now declare the widget states they read, so custom variants participate in nested dependency discovery instead of relying on the framework recognizing a specific variant type. Automatic self-tracking is limited to pointer-driven hover and press; other states still require an ancestor scope or external controller.
Typed focus-visible variants: Added FocusVisibleVariant , ContextVariant.focusVisible() , and onFocusVisible(...) , which apply while focus is highlighted in Flutter's traditional (keyboard/directional) mode.
Pressable semantics roles: Added PressableSemanticsRole with button, link, and neutral roles. PressableBox now forwards the full Pressable focus, keyboard, controller, feedback, cursor, action, and semantics surface.
Typed context variants: BrightnessVariant , BreakpointVariant , OrientationVariant , DirectionalityVariant , PlatformVariant , WebVariant , and NotVariant are now public value objects behind their ContextVariant factories, giving schema and tooling code stable typed data to inspect instead of parsing keys.
Style-state override scope: WidgetStateStyleOverride lets tooling and tests force widget-state variants through normal style resolution, taking precedence over controllers and nested interaction providers without changing component behavior.
Generated Styler field metadata: Every generated Styler now exposes its complete source-field inventory through StylerFieldMetadata.$stylerFieldNames , allowing schema tooling to validate coverage without maintaining duplicate string manifests. Handwritten and previously generated Stylers do not implement this capability until they opt in or are regenerated.
CssKeywordLinearTransform : Adds a reusable bounds-aware GradientTransform for CSS linear-gradient keyword directions, so Tailwind corner gradients can round-trip through schema tooling without losing visual parity.
Pressable input and semantics: Replaced semanticButtonLabel with semanticsLabel , added semanticsRole , and removed the deprecated onKey callback. Use onKeyEvent for custom keyboard handling.
Reserved activation keys: While it holds primary focus and can activate, Pressable owns unmodified Space, Enter, numpad Enter, select, and game button A so it can model held-key state consistently. Override those direct key bindings with onKeyEvent . onPress still honors ActivateIntent dispatched by remapped shortcuts or programmatic invocation, and custom actions can override that binding or handle other intents. Only those five reserved keys are claimed raw; they are left untouched when a descendant holds focus, and modified chords are left to application shortcuts. A link-role Pressable activates with Enter but leaves Space available for scrolling.
Omitted GridBox autoRows no longer throws: Children needing more rows than were declared previously required an explicit autoRows track, or the Grid threw. Omitted autoRows now defaults to GridTrack.auto() , so implicit rows size to their tallest child — both when no rows are declared and when explicit rows run out. Fractional rows still require a bounded height, and fixed tracks remain hard constraints. If you relied on the throw to catch an under-declared Grid, declare rows explicitly or set autoRows to the track you want repeated.
Variant merge priority follows declared state dependencies: Priority now groups active variants by whether they declare ContextVariant.widgetStateDependencies rather than by whether they are a WidgetStateVariant , so onFocusVisible(...) competes by declaration order instead of always losing to any widget-state variant sharing a property, which had been silently replacing focus rings. Variants built on ContextVariant.not(...) move with their inner variant, so onEnabled(...) now outranks an ambient variant such as onDark(...) declared after it.
Declaration order within a priority group is reliable: Grouping is a stable partition rather than a List.sort , which fell back to an unstable quicksort at 32 elements and could reorder equal-priority variants in styles that large.
Nested widget-state discovery: Style.widgetStates now discovers state requirements recursively through nested and negated context-variant branches with identity-based cycle protection, so variants like onDark(BoxStyler().onHovered(...)) and onEnabled(...) are tracked instead of silently never activating. Branches under un-applied named variants are deliberately not tracked because they cannot activate until applyVariants hoists them to the top level.
Interaction detector is mounted only when it can help: StyleBuilder now installs its pointer-interaction detector only for the states that detector actually drives ( hovered / pressed ). States such as disabled and focused can only come from an external WidgetStatesController or an ancestor scope, so styles depending solely on those no longer gain an opaque hit-test target that swallowed pointer events aimed at widgets beneath them, and no longer hijack the state scope of descendants that do track hover.
Pressable lifecycle: Pointer and keyboard press sources are combined without clearing each other, keyboard activation fires once on key-up, cancellation clears held state, focus-visible follows Flutter input modality, and disabled controls ignore custom key handling and expose neither semantic nor custom actions.
Press state ends with the gesture: A pointer that drifts past the tap slop stops counting as a press, so items no longer stay visually pressed while a list scrolls under the finger.
Focus-visible scope: The focus-highlight scope is now provided wherever widget states are, so onFocusVisible also resolves — and repaints on input modality changes — outside a Pressable . A WidgetStateStyleOverride forcing focused now applies it too, matching onFocused .
Variant merge-key collisions: Variant styles now merge by an opaque, semantic identity instead of the human-readable Variant.key . Equivalent named, enum-backed, and built-in context variants still coalesce, while unrelated variants with the same label retain their own predicates. Dynamic builders keep their existing build-then-merge behavior and use function equality instead of a hash string for merge identity.
Context variant equality: ContextVariant.brightness , ContextVariant.breakpoint , ContextVariant.orientation , ContextVariant.directionality , ContextVariant.platform , ContextVariant.web , and ContextVariant.not now compare by their typed values instead of identity, so equivalent variants deduplicate and round-trip predictably.
Default text style modifier merge: Partial DefaultTextStyleModifierMix overrides now merge with the ambient DefaultTextStyle instead of replacing inherited text style fields.
Box shadow blur styles: BoxShadowMix now preserves non-default BoxShadow.blurStyle values across construction, conversion, merging, resolution, diagnostics, equality, and its fluent and factory APIs (#992).
One column per month.
mix_annotations-v2.2.0-beta.1
mix_annotations-v2.2.0-beta.1
MixWidget.target for plain widget constructor tear-offs and
factoryParameters for independent recipe parameter curation.FEAT: Add MixableField.forwardStyler and stylerSurface for opt-in projection of a nested generated Styler's canonical named-factory surface onto its p
MixableField.forwardStyler and stylerSurface for opt-in
projection of a nested generated Styler's canonical named-factory surface
onto its parent Styler (#983).setterType combined with forwardStyler.Style-state override scope: WidgetStateStyleOverride lets tooling and tests force widget-state variants through normal style resolution, taking precedence over controllers and nested interaction providers without changing component behavior.
CssKeywordLinearTransform : Adds a reusable bounds-aware GradientTransform for CSS linear-gradient keyword directions, so Tailwind corner gradients can round-trip through schema tooling without losing visual parity.
Typed context variants: BrightnessVariant , BreakpointVariant , OrientationVariant , DirectionalityVariant , PlatformVariant , WebVariant , and NotVariant are now public value objects behind their ContextVariant factories, giving schema and tooling code stable typed data to inspect instead of parsing keys.
Variant merge-key collisions: Variant styles now merge by an opaque, semantic identity instead of the human-readable Variant.key . Equivalent named, enum-backed, and built-in context variants still coalesce, while unrelated variants with the same label retain their own predicates. Dynamic builders keep their existing build-then-merge behavior and use function equality instead of a hash string for merge identity.
Context variant equality: ContextVariant.brightness , ContextVariant.breakpoint , ContextVariant.orientation , ContextVariant.directionality , ContextVariant.platform , ContextVariant.web , and ContextVariant.not now compare by their typed values instead of identity, so equivalent variants deduplicate and round-trip predictably.
Default text style modifier merge: Partial DefaultTextStyleModifierMix overrides now merge with the ambient DefaultTextStyle instead of replacing inherited text style fields.
FEAT: Add MixWidgetParameterSelection and the MixWidget.widgetParameters default. @MixWidget() now concretely carries .all(), while .only({...}) suppo
MixWidgetParameterSelection and the
MixWidget.widgetParameters default. @MixWidget() now concretely carries
.all(), while .only({...}) supports opt-in curation of generated widget
value parameters. Factory parameters, valid Key? key, and method-level
type parameters remain automatic.DOCS: Document that nested StyleSpec fields derive XStyler automatically by convention, so @MixableField(setterType:) is only needed to override the d
StyleSpec<XSpec> fields derive XStyler
automatically by convention, so @MixableField(setterType:) is only needed
to override the derived name (#961).DOCS: Document @MixableField(setterType:) usage for @MixableSpec and @MixableModifier fields (#950, #951).
@MixableField(setterType:) usage for @MixableSpec and @MixableModifier fields (#950, #951).DEPRECATED: GeneratedStylerMethods.call and GeneratedStylerMethods.skipCall. Call generation has not been supported since the 2.0 styler API; the flag…
@MixableModifier annotation. Annotate a WidgetModifier subclass to generate its modifier mixin and ModifierMix class via mix_generator (#924).@MixWidget annotation. Annotate a top-level styler variable or styler-returning function so mix_generator emits a matching StatelessWidget (#920).extraStylerMixins to control additional mixins applied to generated stylers, and related generator_flags updates (#923).GeneratedStylerMethods.call and GeneratedStylerMethods.skipCall. Call generation has not been supported since the 2.0 styler API; the flags are now annotated @Deprecated and will be removed in a future major release. The bit (0x20) remains in GeneratedStylerMethods.all for source and value compatibility — the generator already ignores it.package:flutter/foundation.dart and package:flutter/widgets.dart imports plus the @immutable annotation, matching the symbols the generated _$<Name> mixin references.GeneratedSpecMethods.skipEquals suppresses only the generated props getter; the surrounding equality surface is always emitted so a user-authored props powers a working ==/hashCode/getDiff/stringify.This release adds context-derived token resolution and richer animation configuration, fixes variant resolution in nested styles and animation interpolation edge cases, and hardens the token-reference system while tightening the public API around the internal token registry.
ContextToken : Zero-config token whose value is derived directly from the build context, so context-dependent values resolve without first registering a token in a scope (#938).
Spring animation helpers: AnimationConfig statics are now factories, with added spring-curve wrappers for configuring physics-based transitions (#937).
Variants in nested styles: A Style nested inside another style's Prop (a component sub-style) now applies its own context variants — widget states, brightness, breakpoints. Previously Prop.resolveProp resolved the merged nested style via resolve() , which skips variants. No-op for nested styles without variants (#926).
Matrix4 interpolation: Tween a transform against the identity matrix when one endpoint is null, instead of producing a degenerate result (#931).
Animation config fallback: Fall back to the previous animation config when a transition resolves to null, rather than dropping the animation (#930).
DoubleRef sentinel collisions: Two distinct MixToken<double> instances whose hashes landed in the same bucket previously aliased to the same sentinel. The registry now hands out sentinels from a monotonic counter, so sentinels are unique among registered tokens; a reverse cache re-issues the same sentinel for the same token.
BreakpointToken.resolve no longer masks type errors: the built-in mobile / tablet / desktop defaults are only used when the scope is absent or omits the entry. A scope entry of the wrong type now surfaces the underlying StateError from MixScope.getToken .
Numeric directives on multi-source props: Prop.value(x).mergeProp( Prop.token(t)).multiply(2) and similar chains now resolve instead of throwing — _asPropNum rebuilds every source as Prop<num> and merges in order.
Prop.value null safety: the token-ref detection branch no longer crashes when V is nullable and the supplied value is null .
ValueRef.noSuchMethod throws UnsupportedError (was UnimplementedError ). The detailed message is unchanged; only the error type differs. Any user code that catches the specific class needs to switch.
getReferenceValue no longer silently casts an unsupported token type — it now throws UnsupportedError naming the token and T . All concrete MixToken subclasses override call() and never hit this path; the change only affects custom MixToken authors who relied on the cast.
Removed from the public API: clearTokenRegistry and getTokenFromValue are no longer re-exported from package:mix/mix.dart (both are now @internal ; tests reach them via package:mix/src/... ). The public DoubleRef(double) constructor was removed — DoubleRef instances are only ever obtained through MixToken<double>.call() . For an explicit, type-safe handle to a double token, use Prop.token(token) .
isAnyTokenRef drops the brittle runtimeType.toString().endsWith(...) check; a Prop carrying a TokenSource is now the sole class-based invariant.
BoxStyler() , TextStyler() , IconStyler() , and related stylers are the primary styling surface. All deprecated spec utilities, legacy widget/style en…
Mix 2.0 is a ground-up rethink of how styling works in Flutter. This release introduces Styler-first APIs with fluent chaining, leverages Dart 3.11+ dot shorthands for concise syntax, modernizes the widget modifier model, and adds full code generation for specs and stylers via mix_annotations / mix_generator .
Styler APIs replace legacy $ utilities. BoxStyler() , TextStyler() , IconStyler() , and related stylers are the primary styling surface. All deprecated spec utilities, legacy widget/style entry points, and unused enum/color helpers have been removed (#806, #870).
Widget modifiers now use WidgetModifierConfig construction instead of older patterns (#775).
Internal resolver usage: resolveProp is @internal ; use MixOps.resolve where you relied on the previous surface (#833).
Minimum SDK: Dart >=3.11.0 , Flutter >=3.41.0 .
Styled widget naming: Legacy Styled* widget names deprecated in favor of new naming conventions (#619).
NestedStyleAttribute removed: Migrate to direct Style usage (#644).
SpecConfiguration/SpecStyle removed from environment (#656).
MixWidgetState renamed to MixWidgetStateModel (#698); MixWidgetStateController deprecated (#586).
Fluent Styler API: Build styles with chained method calls — BoxStyler().color(Colors.blue).size(100, 100).paddingAll(16) .
Styler dot shorthands: Static factory constructors on stylers for Dart 3.11 dot-notation syntax (#857).
Named variants: applyVariants() for applying NamedVariant sets in one place (#801).
Style lookup: Style.of() and Style.maybeOf() for reading resolved styles from the widget tree (#784).
Layout widgets: Callable Stack / FlexBox (and related) for concise composition; Stack / StackBox restructured for the 2.0 model (#779).
Widget builder pattern: Ergonomic Mix API through widget builders (#754).
Default widget styles: Mix widgets ship with sensible defaults out of the box (#759).
Numeric styling: Number directives and extensions for numeric transforms in styles (#785).
Defaults: DefaultStyledText and DefaultStyledIcon typedefs for consistent defaults (#767).
Codegen: MixableSpec / MixableStyler generation, MixableField.setterType , and Style-class extension support in mix_generator (#835, #846, #845).
Animation loops: Loop support for Phase and Keyframe animations (#824).
Unified attributes: SpecUtility , Style , and Attributes unified as compatible values (#643).
Style-focused modifiers and specs: Generated modifiers and specs for streamlined styling (#652).
Builder optimization: Improved style builder performance (#629).
Widget state variant mixins split into focused files; unsupported widget state variants removed (#768, #769).
StyleSpecBuilder build path simplified (#825).
Specs standardized with @immutable ; clearer equality behavior (#821).
BaseStyle utility class introduced for improved styling architecture (#659).
Widget state handling moved from MixBuilder to SpecBuilder (#651).
Docs, examples, and codebase updated to dot-shorthand / Styler syntax throughout.
Variants: More reliable VariantStyle merge and widget state handling in StyleBuilder (#774, #765).
copyWith / lerp: Nullable copyWith parameters; lerp respects nullability (including generator fixes) (#848, #849).
Stylers: chain getter on StackStyler ; AnimationStyleMixin on FlexBoxStyler and StackBoxStyler (#818, #819).
Animations: Visibility stays correct through the end of exit animations (#771). Animation drivers no longer reset when animation configuration is unchanged (#859).
Equality: Mixable now extends EqualityMixin instead of StyleElement (#648).
CopyWith: Overriding bug fixed (#622).
Breakpoints: Breakpoint utility merge exception resolved (#758).
BREAKING: The Mix Generator was completely rebuilt to support the architecture and requirements of Mix V2.0.
REFACTOR: Fix deprecations and modernize codebase (#647).
MixWidgetStateController (#586).REFACTOR: Fix deprecations and modernize codebase (#647).
MixWidgetStateController (#586).REFACTOR: Rename MixableProperty to MixableType (#574).
MixableProperty to MixableType (#574).REFACTOR: Rewrite Fortaleza theme using the new code gen for tokens (#528).
FEAT: Create code gen for design tokens (#521).
FIX: SpecModifiers were taking a long time to animate. (#457).
FEAT: MixableSpec now supports withCopyWith, withEquality, withLerp, and skipUtility (#396).
withCopyWith, withEquality, withLerp, and skipUtility (#396).REFACTOR: bump flutter version to 3.19.0 (#365).
Added MixableEnumUtility, and MixableClassUtility annotations.
- Initial version.
Your coding agent can read these notes before it upgrades. Set up the MCP server →