updateTokens method
void
updateTokens({
- MiniSpacingTokens? spacing,
- MiniRadiusTokens? radius,
- MiniTypographyTokens? typography,
- MiniComponentSizeTokens? componentSizes,
Update token groups (spacing / radius / typography / component sizes) based on the current theme.
Callers usually read tokens from theme, build new token objects via
copyWith or custom constructors, and pass them here to update the theme.
Implementation
void updateTokens({
MiniSpacingTokens? spacing,
MiniRadiusTokens? radius,
MiniTypographyTokens? typography,
MiniComponentSizeTokens? componentSizes,
}) {
final MiniTheme next = _theme.copyWith(
spacing: spacing ?? _theme.spacing,
radius: radius ?? _theme.radius,
typography: typography ?? _theme.typography,
componentSizes: componentSizes ?? _theme.componentSizes,
);
if (identical(next, _theme)) {
return;
}
_theme = next;
notifyListeners();
}