mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-25 13:09:32 +00:00
55 lines
1.8 KiB
Dart
55 lines
1.8 KiB
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class PickerTheme extends ThemeExtension<PickerTheme> {
|
||
|
final Color dividerColor;
|
||
|
final Color? searchIconColor;
|
||
|
final Color searchBackgroundFillColor;
|
||
|
final Color searchTextColor;
|
||
|
final Color? searchHintColor;
|
||
|
|
||
|
PickerTheme(
|
||
|
{required this.dividerColor,
|
||
|
this.searchIconColor,
|
||
|
required this.searchBackgroundFillColor,
|
||
|
required this.searchTextColor,
|
||
|
this.searchHintColor});
|
||
|
|
||
|
@override
|
||
|
PickerTheme copyWith(
|
||
|
{Color? dividerColor,
|
||
|
Color? searchIconColor,
|
||
|
Color? searchBackgroundFillColor,
|
||
|
Color? searchTextColor,
|
||
|
Color? searchHintColor}) =>
|
||
|
PickerTheme(
|
||
|
dividerColor: dividerColor ?? this.dividerColor,
|
||
|
searchIconColor: searchIconColor ?? this.searchIconColor,
|
||
|
searchBackgroundFillColor:
|
||
|
searchBackgroundFillColor ?? this.searchBackgroundFillColor,
|
||
|
searchTextColor: searchTextColor ?? this.searchTextColor,
|
||
|
searchHintColor: searchHintColor ?? this.searchHintColor);
|
||
|
|
||
|
@override
|
||
|
PickerTheme lerp(ThemeExtension<PickerTheme>? other, double t) {
|
||
|
if (other is! PickerTheme) {
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
return PickerTheme(
|
||
|
dividerColor:
|
||
|
Color.lerp(dividerColor, other.dividerColor, t) ?? dividerColor,
|
||
|
searchIconColor:
|
||
|
Color.lerp(searchIconColor, other.searchIconColor, t) ??
|
||
|
searchIconColor,
|
||
|
searchBackgroundFillColor: Color.lerp(searchBackgroundFillColor,
|
||
|
other.searchBackgroundFillColor, t) ??
|
||
|
searchBackgroundFillColor,
|
||
|
searchTextColor:
|
||
|
Color.lerp(searchTextColor, other.searchTextColor, t) ??
|
||
|
searchTextColor,
|
||
|
searchHintColor:
|
||
|
Color.lerp(searchHintColor, other.searchHintColor, t) ??
|
||
|
searchHintColor);
|
||
|
}
|
||
|
}
|