Back navigation fies

This commit is contained in:
Hillel Coren 2020-06-16 09:07:34 +03:00
parent 4edbef68ee
commit 206cd0191e
5 changed files with 6 additions and 14 deletions

View File

@ -43,23 +43,21 @@ List<String> dropdownInvoiceSelector(
return list;
}
var memoizedFilteredInvoiceList = memo6(
var memoizedFilteredInvoiceList = memo5(
(BuiltMap<String, InvoiceEntity> invoiceMap,
BuiltList<String> invoiceList,
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
ListUIState invoiceListState,
String selectedId) =>
ListUIState invoiceListState,) =>
filteredInvoicesSelector(invoiceMap, invoiceList, clientMap, paymentMap,
invoiceListState, selectedId));
invoiceListState));
List<String> filteredInvoicesSelector(
BuiltMap<String, InvoiceEntity> invoiceMap,
BuiltList<String> invoiceList,
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
ListUIState invoiceListState,
String selectedId) {
ListUIState invoiceListState,) {
final Map<String, List<String>> invoicePaymentMap = {};
if (invoiceListState.filterEntityType == EntityType.payment) {
@ -78,10 +76,6 @@ List<String> filteredInvoicesSelector(
final client =
clientMap[invoice.clientId] ?? ClientEntity(id: invoice.clientId);
if (invoice.id == selectedId) {
return true;
}
if (invoiceListState.filterEntityType == EntityType.client) {
if (!invoiceListState.entityMatchesFilter(client)) {
return false;

View File

@ -124,7 +124,7 @@ class _HistoryListTileState extends State<HistoryListTile> {
} else {
entity = state.getEntityMap(history.entityType)[history.id] as BaseEntity;
if (entity == null) {
if (entity == null || !entity.isActive) {
return SizedBox();
}

View File

@ -250,7 +250,7 @@ class MainScreen extends StatelessWidget {
final entity = state.getEntityMap(item.entityType)[item.id]
as BaseEntity;
if (entity == null) {
if (entity == null || !entity.isActive) {
continue;
}

View File

@ -191,7 +191,6 @@ class InvoiceListVM extends EntityListVM {
state.clientState.map,
state.paymentState.map,
state.invoiceListState,
state.invoiceUIState.selectedId,
),
invoiceMap: state.invoiceState.map,
clientMap: state.clientState.map,

View File

@ -50,7 +50,6 @@ class InvoiceScreenVM {
state.clientState.map,
state.paymentState.map,
state.invoiceListState,
state.invoiceUIState.selectedId,
),
userCompany: state.userCompany,
isInMultiselect: state.invoiceListState.isInMultiselect(),