In our pursuit of API usability and efficiency, we introduced several deprecations in the latest Mix Package versions. When encountering issues not covered by deprecation notices, please open an issue or send a PR to our deprecation file (opens in a new tab).
The major updates are:
Mix class is now
Style. Several methods in the renamed class, including
withManyVariants among others, are deprecated to boost performance and reduce potential confusion.
IconMix widgets are deprecated. Use
To enhance readability, short aliases and shorthand property/method names are replaced with fully named counterparts.
Decorators' order was previously determined by their addition sequence. Now, we enforce specific ordering but also allow customizable orders. This might cause behavior changes in rare cases. For details, refer to the decorators guide (opens in a new tab).
To provide a more consistent way to use the gesture APIs, we developed a new widget that merges the functionalities of Box and
Pressable. Thus, the new
PressableBox can receive a style like a Box and also accept interactions and its variants, similar to a
Pressable. For more information, see the PressableBox guide (opens in a new tab).
Keep in mind that the ideia is to reserve the old
Pressable to more advanced cases.
Decorators cannot be inherited by any children. The reason is that abstract class
Attribute has gained a new property,
isInheritable, witch can be set to false if you want your custom attributes to be non-inheritable, such as Decorators.
The operators have been redesigned to allow for concatenation and grouping, enabling the creation of conditions like,
(primary | secondary) & onHover. For details, refer to the variants guide (opens in a new tab)
A bunch of
StyledWidgets are now allow to receive decorators' attributes, including
StyledIcon. Additionally, when a decorator is not applied to a Style, a
RenderWidgetDecorators will not be present in the widget tree. This simplification makes the widget easier to debug.
MixTheme feature has been improved and now offer better API. It can applied to main attributes using the method
.of, as shown in the following code:
const primaryColor = ColorToken('primary');
final theme = MixThemeData(
// ... body method ...