generate method
dynamic
generate(
- dynamic theme
)
override
Implementation
@override
generate(dynamic theme) {
if (theme == null) {
if (style != null) {
return CardTheme(
color: style!.background,
shape: style!.shape(),
elevation: style!.elevation,
margin: style!.margin,
shadowColor: style!.shadow,
);
} else {
return null;
}
} else {
if (style != null) {
return (theme as CardTheme).copyWith(
color: style!.background ?? theme.color,
shape: style!.shape() ?? theme.shape,
elevation: style!.elevation ?? theme.elevation,
margin: style!.margin ?? theme.margin,
shadowColor: style!.shadow ?? theme.shadowColor,
surfaceTintColor: style!.surfaceTint ?? theme.surfaceTintColor,
);
} else {
return theme as CardTheme;
}
}
}