import 'package:flutter/material.dart'; class ConnectionButtonTheme extends ThemeExtension { const ConnectionButtonTheme({ this.idleColor, this.connectedColor, }); final Color? idleColor; final Color? connectedColor; static const ConnectionButtonTheme light = ConnectionButtonTheme( idleColor: Color(0xFF4a4d8b), connectedColor: Color(0xFF44a334), ); @override ThemeExtension copyWith({ Color? idleColor, Color? connectedColor, }) => ConnectionButtonTheme( idleColor: idleColor ?? this.idleColor, connectedColor: connectedColor ?? this.connectedColor, ); @override ThemeExtension lerp( covariant ThemeExtension? other, double t, ) { if (other is! ConnectionButtonTheme) { return this; } return ConnectionButtonTheme( idleColor: Color.lerp(idleColor, other.idleColor, t), connectedColor: Color.lerp(connectedColor, other.connectedColor, t), ); } }