mix_generator 2.1.1
mix_generator: ^2.1.1 copied to clipboard
A code generator for Mix, an expressive way to effortlessly build design systems in Flutter.
2.1.1 #
- FEAT: Support
@MixableField(setterType:)on@MixableModifierfields. GeneratedModifierMixconstructors accept the declared Mix type and wrap values withProp.maybeMix(#950). - FEAT: Support
@MixableField(setterType:)on@MixableSpecfields. Generated spec stylers expose Mix-typed setters and field factories for nestedStyleSpecfields (#951).
2.1.0 #
- FEAT: Add
@MixableModifiergenerator. Annotate aWidgetModifiersubclass to generate its modifier mixin andModifierMixclass. Requiresmix_annotations^2.1.0(#924). - FEAT: Generate spec stylers with parity coverage, emitting styler methods that match the spec's resolvable surface (#923).
- TEST: Cover the single-field
debugFillPropertiescascade in generated output (#942). - FEAT: Add
@MixWidgetgenerator. Annotate a top-levelfinalstyler variable or a styler-returning function; the generator emits aStatelessWidgetwhosebuild()delegates to that styler'scall(). Constructor parameters mirror the styler'scall()signature, withKey? keyforwarded viasuper.key. - CHORE: Match Flutter's canonical
Keytype viaTypeCheckerinstead of comparing parameter type names. The stylercall()may declare exactlyKey? key(named, nullable, no default, notrequired) to opt intosuper.keyforwarding. Any otherkey-named parameter — subclasses such asLocalKey?/GlobalKey?, non-nullableKey, positional, defaulted, or akeyparameter on the factory function — is rejected with anInvalidGenerationSourceerror. - CHORE: Generated
build()now forwards every constructor field asthis.<name>so user parameter names cannot be shadowed bybuild()'s localcontextor by the factory reference. Parameter names matching the factory identifier or inheritedStatelessWidget/Widget/Objectmembers (build,createElement,runtimeType,hashCode,toString,noSuchMethod) are now rejected withInvalidGenerationSource. - CHORE:
@MixWidget(name: '...')overrides are validated as Dart class identifiers; non-identifier shapes and Dart reserved words are rejected. - CHORE: The annotated library must import
package:flutter/widgets.dartwithout a prefix. Prefixed Flutter imports are rejected with a clear error pointing to the unprefixed import (or a barrel re-export). - CHORE:
@MixWidgetrequires the annotated element's name to belowerCamelCaseending inStyle. Names that don't match are rejected; use@MixWidget(name: '...')to override. - FEAT: Emit a
@Deprecated typedef _$<Name>SpecMethods = _$<Name>;alongside every@MixableSpecmixin so legacyclass X extends Spec<X> with Diagnosticable, _$XSpecMethodsdeclarations keep compiling against the 2.0+ generator. Removal scheduled formix_generator3.0. - CHANGED: Under the legacy declaration shape,
toString()now routes throughDiagnosticable.toDiagnosticsNode, replacing Equatable'sX(field: …)format with Flutter's diagnostic-node format. Update any tests that pinned the old string. - CHORE: Drop unused direct dependencies (
collection,build_config,logging,path); the generator no longer references them. - FIX:
GeneratedSpecMethods.skipEqualsnow only suppressespropsgeneration. The rest of the equality surface (==,hashCode,getDiff,stringify) is always emitted, preserving the supported "user authorsprops" flag semantic after the spec-shape refactor. - FIX:
Prop<T>detection now uses a URL-basedTypeChecker(package:mix/src/core/prop.dart#Prop) instead of matching on the simple nameProp. Prevents unrelated local classes namedPropfrom being mistaken for Mix'sProp. - FIX:
@Mixablevalidation now requires the annotated class to extendMix<T>(or a subclass) directly. Classes extendingMixable<T>without going throughMix<T>are rejected with a clear error — the generated mixin'son Mix<T>constraint would have failed at apply time anyway. - TEST: Consolidate generator test helpers (
partBuilder,styleStub,mixElementStub,propStub,mixAnnotationsSources) intotest/core/test_helpers.dart. Adds regression tests forskipEquals, fake-Prop<T>rejection, andMixable<T>-direct-subclass rejection.
2.0.1 #
- REFACTOR: Tighten field-model validation and shared type-helper extraction across mix/styler generators (#895).
- TEST: Add generator smoke and validation integration tests plus broader builder coverage (#895).
2.0.0 #
- Stable release matching the
2.0.0-rc.1surface, with READMEs refreshed for the 2.0 generator API (#887, #888).
2.0.0-rc.1 #
- BREAKING: The Mix Generator was completely rebuilt to support the architecture and requirements of Mix V2.0.
- FEAT: Support Style class extensions in code generation (#845).
- FEAT: Add MixableSpec, MixableStyler, and code generation for properties (#835).
- FIX: Respect nullability in lerp resolver.
- FIX: Make copyWith parameters nullable (#848).
1.7.0 #
- REFACTOR: Rename WidgetModifiersData to WidgetModifiersConfig (#649).
- REFACTOR: Fix deprecations and modernize codebase (#647).
- FIX: update animated property handling to use null coalescing (#637).
- FEAT: Add generated style-focused modifiers and specs (#652).
- FEAT: unify SpecUtility, Style, and Attributes as compatible values (#643).
- FEAT: builder optimization (#629).
0.4.0 #
- REFACTOR: Rename
MixablePropertytoMixableType(#574) - REFACTOR: mix generator clean up and mix semantic changes (#569)
- CHORE: Update min version compatibility (#572)
0.3.2 #
- REFACTOR: Rewrite Fortaleza theme using the new code gen for tokens (#528).
- FIX: Shadow list animation (#445).
- FEAT: Create code gen for design tokens (#521).
- FEAT: Rewrite FlexBox as a Mix's primitive component (#517).
- FEAT: Fluent API (#475).
- FEAT: Remix improvements and further improvements (#410).
- DOCS: improve mix theme data features explanations (#404).
0.3.1 #
- FEAT: Fluent API (#475).
0.3.0 #
- FIX: SpecModifiers were taking a long time to animate. (#457).
- FIX: Shadow list animation (#445).
0.2.2+1 #
- DOCS: improve mix theme data features explanations (#404).
0.2.2 #
- FEAT: Code generation for Widget Modifiers (#396).
- FEAT: Dto utility generation now adds constructor and static methods (#377).
- FEAT: ColorSwatchToken and other token improvements (#378).
- REFACTOR: Code gen more lint friendly dart code (#399) and (#395).
- FIX: Nullable merge expressions and updates debug properties (#392).
0.2.1 #
- REFACTOR: bump flutter version to 3.19.0 (#365).
- FEAT: modifiers in spec (#333).
0.2.0 #
- Fixed: issue with getting correct type override from MixableDto
- Improved: Dto resolved type look up logic
- Added: generation List of value extension of a Dto
- Added: Class and Enum utility generation
0.1.2 #
- Fixed: Resolved conflict on generators when not configured on build.yaml
0.1.1 #
- Added: Support for Spec Attributes
0.1.0 #
- Initial release.