copyWith method
MkxThemeData
copyWith({
- ColorScheme? colorScheme,
- InputDecorationTheme? inputDecorationTheme,
- ElevatedButtonThemeData? elevatedButtonTheme,
Creates a copy of this MkxThemeData with the given fields replaced
Returns a new instance with the same values except for the fields specified as arguments.
Example:
// Start with a theme that has custom input decoration
final baseThemeData = MkxThemeData(
inputDecorationTheme: myCustomInputTheme,
);
// Create a variation with custom button theme
final updatedThemeData = baseThemeData.copyWith(
elevatedButtonTheme: myCustomButtonTheme,
);
Implementation
MkxThemeData copyWith({
ColorScheme? colorScheme,
InputDecorationTheme? inputDecorationTheme,
ElevatedButtonThemeData? elevatedButtonTheme,
}) {
return MkxThemeData(
colorScheme: colorScheme ?? this.colorScheme,
inputDecorationTheme: inputDecorationTheme ?? this.inputDecorationTheme,
elevatedButtonTheme: elevatedButtonTheme ?? this.elevatedButtonTheme,
);
}