custom filters
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
/// Visibility flags for built-in Home screen sections.
|
||||
library;
|
||||
|
||||
class HomeBuiltInSections {
|
||||
const HomeBuiltInSections({
|
||||
this.showTransactions = true,
|
||||
this.showCategorized = true,
|
||||
this.showRecent = true,
|
||||
});
|
||||
|
||||
static const defaults = HomeBuiltInSections();
|
||||
|
||||
final bool showTransactions;
|
||||
final bool showCategorized;
|
||||
final bool showRecent;
|
||||
|
||||
HomeBuiltInSections copyWith({
|
||||
bool? showTransactions,
|
||||
bool? showCategorized,
|
||||
bool? showRecent,
|
||||
}) {
|
||||
return HomeBuiltInSections(
|
||||
showTransactions: showTransactions ?? this.showTransactions,
|
||||
showCategorized: showCategorized ?? this.showCategorized,
|
||||
showRecent: showRecent ?? this.showRecent,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'showTransactions': showTransactions,
|
||||
'showCategorized': showCategorized,
|
||||
'showRecent': showRecent,
|
||||
};
|
||||
|
||||
factory HomeBuiltInSections.fromJson(Map<String, dynamic>? json) {
|
||||
if (json == null) return defaults;
|
||||
return HomeBuiltInSections(
|
||||
showTransactions: json['showTransactions'] as bool? ?? true,
|
||||
showCategorized: json['showCategorized'] as bool? ?? true,
|
||||
showRecent: json['showRecent'] as bool? ?? true,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user