You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Mix relies on custom enum methods to define and access specific values. However, the Dart language team is planning to introduce enum shorthand syntax, which will provide a more native way to handle enum values without requiring additional methods.
Maintaining custom enum methods after this update would lead to unnecessary, as this custom methods were implemented to simplify the usage.
Proposed Changes
Deprecate all existing enum methods across Mix.
Remove the need for @MixableEnumUtility() annotation, as enum shorthand will provide a more concise syntax.
Reduce the number of functions in the API, making the framework easier to maintain and lowering support costs.
Before
$flex.direction.horizontal()
After
$flex.direction(Axis.horizontal)
Future with Enum Shorthand
$flex.direction(.horizontal)
Impact Analysis
Benefits
Removes unnecessary custom methods declaration and will align with future Dart lang futures. It will improve the maintainability due to the decreasing of methods
Potential Drawbacks
Breaking Changes for Existing Codebases
Dependence on Dart’s Enum Shorthand Timeline.
Implementation Plan
Tasks
Remove the @MixableEnumUtility annotation and all the code gen related
Guarantee that all enum attributes are implementing the call method with the respective enum parameter
Update Documentation
Testing Strategy
There is no specific strategy
Additional Considerations
Boolean Attributes
Currently, boolean attributes utilize a specific utility that implements .on and .off methods. We propose removing these methods in favor of a more straightforward implementation that aligns with the new enum format. This change align the syntax.
Proposed Changes:
Description
Currently, Mix relies on custom enum methods to define and access specific values. However, the Dart language team is planning to introduce enum shorthand syntax, which will provide a more native way to handle enum values without requiring additional methods.
Maintaining custom enum methods after this update would lead to unnecessary, as this custom methods were implemented to simplify the usage.
Proposed Changes
@MixableEnumUtility()
annotation, as enum shorthand will provide a more concise syntax.Before
$flex.direction.horizontal()
After
Future with Enum Shorthand
$flex.direction(.horizontal)
Impact Analysis
Benefits
Potential Drawbacks
Implementation Plan
Tasks
@MixableEnumUtility
annotation and all the code gen relatedTesting Strategy
There is no specific strategy
Additional Considerations
Boolean Attributes
Currently, boolean attributes utilize a specific utility that implements
.on
and.off
methods. We propose removing these methods in favor of a more straightforward implementation that aligns with the new enum format. This change align the syntax.Proposed Changes:
Before
text.textHeightBehavior.heightToLastDescent.on(),
After
The text was updated successfully, but these errors were encountered: