import 'package:flutter/material.dart'; class TableTheme extends ThemeExtension { final Color? titleTextColor; final Color? titleBackgroundColor; final Color? dataTextColor; final Color? dataErrorTextColor; final Color? dataSuccesTextColor; final Color? dataBackgroundColor; final Color? infoBackgroundColor; final Color? infoTextColor; TableTheme({ this.titleTextColor, this.dataTextColor, this.titleBackgroundColor, this.dataBackgroundColor, this.dataSuccesTextColor, this.dataErrorTextColor, this.infoBackgroundColor, this.infoTextColor, }); @override ThemeExtension copyWith({ Color? titleTextColor, Color? titleBackgroundColor, Color? dataTextColor, Color? dataSuccesTextColor, Color? dataErrorTextColor, Color? dataBackgroundColor, Color? infoBackgroundColor, Color? infoTextColor, }) { return TableTheme( titleTextColor: titleTextColor ?? this.titleTextColor, titleBackgroundColor: titleBackgroundColor ?? this.titleBackgroundColor, dataTextColor: dataTextColor ?? this.dataTextColor, dataSuccesTextColor: dataSuccesTextColor ?? this.dataSuccesTextColor, dataErrorTextColor: dataErrorTextColor ?? this.dataErrorTextColor, dataBackgroundColor: dataBackgroundColor ?? this.dataBackgroundColor, infoBackgroundColor: infoBackgroundColor ?? this.infoBackgroundColor, infoTextColor: infoTextColor ?? this.infoTextColor, ); } @override ThemeExtension lerp(covariant ThemeExtension? other, double t) { if (other is! TableTheme) { return this; } return TableTheme( titleTextColor: Color.lerp(titleTextColor, other.titleTextColor, t), titleBackgroundColor: Color.lerp(titleBackgroundColor, other.titleBackgroundColor, t), dataTextColor: Color.lerp(dataTextColor, other.dataTextColor, t), dataSuccesTextColor: Color.lerp(dataSuccesTextColor, other.dataSuccesTextColor, t), dataErrorTextColor: Color.lerp(dataErrorTextColor, other.dataErrorTextColor, t), dataBackgroundColor: Color.lerp(dataBackgroundColor, other.dataBackgroundColor, t), infoBackgroundColor: Color.lerp(infoBackgroundColor, other.infoBackgroundColor, t), infoTextColor: Color.lerp(infoTextColor, other.infoTextColor, t), ); } }