-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
1,948 additions
and
1,284 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
part of 'accounts_cubit.dart'; | ||
|
||
class AccountsState extends Equatable { | ||
final String categoryId; | ||
final DataStatus status; | ||
final List<Account> accountList; | ||
final AccountsViewFilter filter; | ||
final String? errorMessage; | ||
|
||
const AccountsState( | ||
{required this.categoryId, this.status = DataStatus.loading, | ||
{this.status = DataStatus.loading, | ||
this.accountList = const [], | ||
required this.filter, | ||
this.errorMessage}); | ||
|
||
List<Account> get filteredAccounts => filter.applyAll(accountList); | ||
|
||
AccountsState copyWith({ | ||
String? budgetId, | ||
String? categoryId, | ||
DataStatus? status, | ||
List<Account>? accountList, | ||
AccountsViewFilter? filter, | ||
String? errorMessage, | ||
}) { | ||
return AccountsState( | ||
categoryId: categoryId ?? this.categoryId, | ||
status: status ?? this.status, | ||
accountList: accountList ?? this.accountList, | ||
filter: filter ?? this.filter, | ||
errorMessage: errorMessage ?? this.errorMessage, | ||
); | ||
} | ||
|
||
@override | ||
List<Object> get props => [categoryId, status, accountList]; | ||
List<Object> get props => [status, accountList, filter]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'account.dart'; | ||
|
||
class AccountsViewFilter { | ||
final String filterId; | ||
const AccountsViewFilter({required this.filterId}); | ||
|
||
bool apply({required Account account}) { | ||
return account.categoryId == filterId; | ||
} | ||
|
||
List<Account> applyAll(Iterable<Account> accountsList) { | ||
return accountsList.where((acc) => apply(account: acc)).toList(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// defined in app.dart | ||
import 'package:adaptive_breakpoints/adaptive_breakpoints.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
late double w; | ||
late double h; | ||
|
||
bool isDisplayDesktop(BuildContext context) => | ||
getWindowType(context) >= AdaptiveWindowType.medium; |
Oops, something went wrong.