Back navigation fies
This commit is contained in:
parent
4edbef68ee
commit
206cd0191e
|
|
@ -43,23 +43,21 @@ List<String> dropdownInvoiceSelector(
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
var memoizedFilteredInvoiceList = memo6(
|
var memoizedFilteredInvoiceList = memo5(
|
||||||
(BuiltMap<String, InvoiceEntity> invoiceMap,
|
(BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||||
BuiltList<String> invoiceList,
|
BuiltList<String> invoiceList,
|
||||||
BuiltMap<String, ClientEntity> clientMap,
|
BuiltMap<String, ClientEntity> clientMap,
|
||||||
BuiltMap<String, PaymentEntity> paymentMap,
|
BuiltMap<String, PaymentEntity> paymentMap,
|
||||||
ListUIState invoiceListState,
|
ListUIState invoiceListState,) =>
|
||||||
String selectedId) =>
|
|
||||||
filteredInvoicesSelector(invoiceMap, invoiceList, clientMap, paymentMap,
|
filteredInvoicesSelector(invoiceMap, invoiceList, clientMap, paymentMap,
|
||||||
invoiceListState, selectedId));
|
invoiceListState));
|
||||||
|
|
||||||
List<String> filteredInvoicesSelector(
|
List<String> filteredInvoicesSelector(
|
||||||
BuiltMap<String, InvoiceEntity> invoiceMap,
|
BuiltMap<String, InvoiceEntity> invoiceMap,
|
||||||
BuiltList<String> invoiceList,
|
BuiltList<String> invoiceList,
|
||||||
BuiltMap<String, ClientEntity> clientMap,
|
BuiltMap<String, ClientEntity> clientMap,
|
||||||
BuiltMap<String, PaymentEntity> paymentMap,
|
BuiltMap<String, PaymentEntity> paymentMap,
|
||||||
ListUIState invoiceListState,
|
ListUIState invoiceListState,) {
|
||||||
String selectedId) {
|
|
||||||
final Map<String, List<String>> invoicePaymentMap = {};
|
final Map<String, List<String>> invoicePaymentMap = {};
|
||||||
|
|
||||||
if (invoiceListState.filterEntityType == EntityType.payment) {
|
if (invoiceListState.filterEntityType == EntityType.payment) {
|
||||||
|
|
@ -78,10 +76,6 @@ List<String> filteredInvoicesSelector(
|
||||||
final client =
|
final client =
|
||||||
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
|
||||||
|
|
||||||
if (invoice.id == selectedId) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (invoiceListState.filterEntityType == EntityType.client) {
|
if (invoiceListState.filterEntityType == EntityType.client) {
|
||||||
if (!invoiceListState.entityMatchesFilter(client)) {
|
if (!invoiceListState.entityMatchesFilter(client)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ class _HistoryListTileState extends State<HistoryListTile> {
|
||||||
} else {
|
} else {
|
||||||
entity = state.getEntityMap(history.entityType)[history.id] as BaseEntity;
|
entity = state.getEntityMap(history.entityType)[history.id] as BaseEntity;
|
||||||
|
|
||||||
if (entity == null) {
|
if (entity == null || !entity.isActive) {
|
||||||
return SizedBox();
|
return SizedBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,7 @@ class MainScreen extends StatelessWidget {
|
||||||
|
|
||||||
final entity = state.getEntityMap(item.entityType)[item.id]
|
final entity = state.getEntityMap(item.entityType)[item.id]
|
||||||
as BaseEntity;
|
as BaseEntity;
|
||||||
if (entity == null) {
|
if (entity == null || !entity.isActive) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,6 @@ class InvoiceListVM extends EntityListVM {
|
||||||
state.clientState.map,
|
state.clientState.map,
|
||||||
state.paymentState.map,
|
state.paymentState.map,
|
||||||
state.invoiceListState,
|
state.invoiceListState,
|
||||||
state.invoiceUIState.selectedId,
|
|
||||||
),
|
),
|
||||||
invoiceMap: state.invoiceState.map,
|
invoiceMap: state.invoiceState.map,
|
||||||
clientMap: state.clientState.map,
|
clientMap: state.clientState.map,
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ class InvoiceScreenVM {
|
||||||
state.clientState.map,
|
state.clientState.map,
|
||||||
state.paymentState.map,
|
state.paymentState.map,
|
||||||
state.invoiceListState,
|
state.invoiceListState,
|
||||||
state.invoiceUIState.selectedId,
|
|
||||||
),
|
),
|
||||||
userCompany: state.userCompany,
|
userCompany: state.userCompany,
|
||||||
isInMultiselect: state.invoiceListState.isInMultiselect(),
|
isInMultiselect: state.invoiceListState.isInMultiselect(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue