Flutter upgrade

This commit is contained in:
M
2022-10-12 13:09:57 -04:00
parent c921ad890a
commit 1beb18b045
505 changed files with 6657 additions and 5875 deletions
+8 -8
View File
@@ -10,26 +10,26 @@ part 'orders_store.g.dart';
class OrdersStore = OrdersStoreBase with _$OrdersStore;
abstract class OrdersStoreBase with Store {
OrdersStoreBase({this.ordersSource, this.settingsStore}) {
orders = <OrderListItem>[];
orderId = '';
OrdersStoreBase({required this.ordersSource,
required this.settingsStore})
: orders = <OrderListItem>[],
orderId = '' {
_onOrdersChanged =
ordersSource.watch().listen((_) async => await updateOrderList());
updateOrderList();
}
Box<Order> ordersSource;
StreamSubscription<BoxEvent> _onOrdersChanged;
SettingsStore settingsStore;
StreamSubscription<BoxEvent>? _onOrdersChanged;
@observable
List<OrderListItem> orders;
@observable
Order order;
Order? order;
@observable
String orderId;
+1 -1
View File
@@ -45,7 +45,7 @@ abstract class TradeFilterStoreBase with Store {
}
}
List<TradeListItem> filtered({List<TradeListItem> trades, WalletBase wallet}) {
List<TradeListItem> filtered({required List<TradeListItem> trades, required WalletBase wallet}) {
final _trades =
trades.where((item) => item.trade.walletId == wallet.id).toList();
final needToFilter = !displayChangeNow || !displayXMRTO || !displayMorphToken || !displaySimpleSwap;
+13 -10
View File
@@ -10,31 +10,34 @@ part 'trades_store.g.dart';
class TradesStore = TradesStoreBase with _$TradesStore;
abstract class TradesStoreBase with Store {
TradesStoreBase({this.tradesSource, this.settingsStore}) {
trades = <TradeListItem>[];
TradesStoreBase({required this.tradesSource, required this.settingsStore})
: trades = <TradeListItem>[] {
_onTradesChanged =
tradesSource.watch().listen((_) async => await updateTradeList());
updateTradeList();
}
Box<Trade> tradesSource;
StreamSubscription<BoxEvent> _onTradesChanged;
StreamSubscription<BoxEvent>? _onTradesChanged;
SettingsStore settingsStore;
@observable
List<TradeListItem> trades;
@observable
Trade trade;
Trade? trade;
@action
void setTrade(Trade trade) => this.trade = trade;
@action
Future updateTradeList() async => trades =
tradesSource.values.map((trade) => TradeListItem(
trade: trade,
settingsStore: settingsStore)).toList();
Future<void> updateTradeList() async {
if (trade == null) {
return;
}
trades = tradesSource.values.map((trade) => TradeListItem(
trade: trade!,
settingsStore: settingsStore)).toList();
}
}
@@ -18,10 +18,10 @@ abstract class TransactionFilterStoreBase with Store {
bool displayOutgoing;
@observable
DateTime startDate;
DateTime? startDate;
@observable
DateTime endDate;
DateTime? endDate;
@action
void toggleIncoming() => displayIncoming = !displayIncoming;
@@ -35,7 +35,7 @@ abstract class TransactionFilterStoreBase with Store {
@action
void changeEndDate(DateTime date) => endDate = date;
List<TransactionListItem> filtered({List<TransactionListItem> transactions}) {
List<TransactionListItem> filtered({required List<TransactionListItem> transactions}) {
var _transactions = <TransactionListItem>[];
final needToFilter = !displayOutgoing ||
!displayIncoming ||
@@ -46,8 +46,8 @@ abstract class TransactionFilterStoreBase with Store {
var allowed = true;
if (allowed && startDate != null && endDate != null) {
allowed = startDate.isBefore(item.transaction.date) &&
endDate.isAfter(item.transaction.date);
allowed = (startDate?.isBefore(item.transaction.date) ?? false)
&& (endDate?.isAfter(item.transaction.date) ?? false);
}
if (allowed && (!displayOutgoing || !displayIncoming)) {