copyWith method
ThemeExtension<TDThemeData>
copyWith({
- String? name,
- Map<
String, Color> ? colorMap, - Map<
String, Font> ? fontMap, - Map<
String, double> ? radiusMap, - Map<
String, FontFamily> ? fontFamilyMap, - Map<
String, List< ? shadowMap,BoxShadow> > - Map<
String, double> ? marginMap, - TDExtraThemeData? extraThemeData,
override
Creates a copy of this theme extension with the given fields replaced by the non-null parameter values.
Implementation
@override
ThemeExtension<TDThemeData> copyWith({
String? name,
Map<String, Color>? colorMap,
Map<String, Font>? fontMap,
Map<String, double>? radiusMap,
Map<String, FontFamily>? fontFamilyMap,
Map<String, List<BoxShadow>>? shadowMap,
Map<String, double>? marginMap,
TDExtraThemeData? extraThemeData,
}) {
var result = TDThemeData(
name: name ?? 'default',
colorMap: _copyMap<Color>(this.colorMap, colorMap),
fontMap: _copyMap<Font>(this.fontMap, fontMap),
radiusMap: _copyMap<double>(this.radiusMap, radiusMap),
fontFamilyMap: _copyMap<FontFamily>(this.fontFamilyMap, fontFamilyMap),
shadowMap: _copyMap<List<BoxShadow>>(this.shadowMap, shadowMap),
spacerMap: _copyMap<double>(spacerMap, marginMap),
extraThemeData: extraThemeData ?? this.extraThemeData);
return result;
}