cake_wallet/lib/themes/extensions/wallet_list_theme.dart

39 lines
1.4 KiB
Dart
Raw Normal View History

2023-07-03 20:40:58 +00:00
import 'package:flutter/material.dart';
class WalletListTheme extends ThemeExtension<WalletListTheme> {
final Color restoreWalletButtonTextColor;
final Color createNewWalletButtonBackgroundColor;
WalletListTheme(
{required this.restoreWalletButtonTextColor,
required this.createNewWalletButtonBackgroundColor});
@override
WalletListTheme copyWith(
{Color? restoreWalletButtonTextColor,
Color? createNewWalletButtonBackgroundColor}) =>
WalletListTheme(
restoreWalletButtonTextColor:
restoreWalletButtonTextColor ?? this.restoreWalletButtonTextColor,
createNewWalletButtonBackgroundColor:
createNewWalletButtonBackgroundColor ??
this.createNewWalletButtonBackgroundColor);
@override
WalletListTheme lerp(ThemeExtension<WalletListTheme>? other, double t) {
if (other is! WalletListTheme) {
return this;
}
return WalletListTheme(
restoreWalletButtonTextColor: Color.lerp(restoreWalletButtonTextColor,
other.restoreWalletButtonTextColor, t) ??
restoreWalletButtonTextColor,
createNewWalletButtonBackgroundColor: Color.lerp(
createNewWalletButtonBackgroundColor,
other.createNewWalletButtonBackgroundColor,
t) ??
createNewWalletButtonBackgroundColor);
}
}