Skip to content

Commit

Permalink
Fix for back button
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Jun 6, 2023
1 parent 530091c commit f3dbf0b
Show file tree
Hide file tree
Showing 23 changed files with 182 additions and 60 deletions.
38 changes: 21 additions & 17 deletions lib/redux/app/app_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ class SwitchListTableLayout implements PersistUI, PersistPrefs {}

class PopLastHistory implements PersistUI {}

class UpdateLastHistory implements PersistUI {
const UpdateLastHistory(this.page);

final int page;
}

class DismissNativeWarning implements PersistUI {}

class DismissNativeWarningPermanently implements PersistUI, PersistPrefs {}
Expand Down Expand Up @@ -329,6 +335,7 @@ void filterByEntity({
void viewEntitiesByType({
@required EntityType entityType,
BaseEntity filterEntity,
int page = 0,
}) {
final store = StoreProvider.of<AppState>(navigatorKey.currentContext);
final uiState = store.state.uiState;
Expand Down Expand Up @@ -371,13 +378,13 @@ void viewEntitiesByType({
);
break;
case EntityType.client:
action = ViewClientList();
action = ViewClientList(page: page);
break;
case EntityType.user:
action = ViewUserList();
break;
case EntityType.project:
action = ViewProjectList();
action = ViewProjectList(page: page);
break;
case EntityType.taxRate:
action = ViewTaxRateList();
Expand All @@ -386,25 +393,25 @@ void viewEntitiesByType({
action = ViewCompanyGatewayList();
break;
case EntityType.invoice:
action = ViewInvoiceList();
action = ViewInvoiceList(page: page);
break;
case EntityType.quote:
action = ViewQuoteList();
action = ViewQuoteList(page: page);
break;
case EntityType.vendor:
action = ViewVendorList();
action = ViewVendorList(page: page);
break;
case EntityType.product:
action = ViewProductList();
action = ViewProductList(page: page);
break;
case EntityType.task:
action = ViewTaskList();
action = ViewTaskList(page: page);
break;
case EntityType.expense:
action = ViewExpenseList();
action = ViewExpenseList(page: page);
break;
case EntityType.payment:
action = ViewPaymentList();
action = ViewPaymentList(page: page);
break;
case EntityType.group:
action = ViewGroupList();
Expand All @@ -416,20 +423,17 @@ void viewEntitiesByType({
case EntityType.transactionRule:
action = ViewTransactionRuleList();
break;

case EntityType.transaction:
action = ViewTransactionList();
action = ViewTransactionList(page: page);
break;

case EntityType.bankAccount:
action = ViewBankAccountList();
break;

case EntityType.purchaseOrder:
action = ViewPurchaseOrderList();
action = ViewPurchaseOrderList(page: page);
break;
case EntityType.recurringExpense:
action = ViewRecurringExpenseList();
action = ViewRecurringExpenseList(page: page);
break;
case EntityType.subscription:
action = ViewSubscriptionList();
Expand All @@ -441,7 +445,7 @@ void viewEntitiesByType({
action = ViewExpenseCategoryList();
break;
case EntityType.recurringInvoice:
action = ViewRecurringInvoiceList();
action = ViewRecurringInvoiceList(page: page);
break;
case EntityType.webhook:
action = ViewWebhookList();
Expand All @@ -456,7 +460,7 @@ void viewEntitiesByType({
action = ViewDesignList();
break;
case EntityType.credit:
action = ViewCreditList();
action = ViewCreditList(page: page);
break;
}

Expand Down
2 changes: 2 additions & 0 deletions lib/redux/client/client_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
class ViewClientList implements PersistUI {
ViewClientList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewClient implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/credit/credit_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ import 'package:invoiceninja_flutter/data/web_client.dart';
import 'package:printing/printing.dart';

class ViewCreditList implements PersistUI {
ViewCreditList({this.force = false});
ViewCreditList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewCredit implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/expense/expense_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ import 'package:invoiceninja_flutter/utils/dialogs.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';

class ViewExpenseList implements PersistUI {
ViewExpenseList({this.force = false});
ViewExpenseList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewExpense implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/invoice/invoice_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ import 'package:invoiceninja_flutter/data/web_client.dart';
import 'package:printing/printing.dart';

class ViewInvoiceList implements PersistUI {
ViewInvoiceList({this.force = false});
ViewInvoiceList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewInvoice implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/payment/payment_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ import 'package:invoiceninja_flutter/utils/completers.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';

class ViewPaymentList implements PersistUI {
ViewPaymentList({this.force = false});
ViewPaymentList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewPayment implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/product/product_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
import '../document/document_actions.dart';

class ViewProductList implements PersistUI {
ViewProductList({this.force = false});
ViewProductList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewProduct implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/project/project_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ import 'package:invoiceninja_flutter/utils/dialogs.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';

class ViewProjectList implements PersistUI {
ViewProjectList({this.force = false});
ViewProjectList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewProject implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/purchase_order/purchase_order_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ import 'package:printing/printing.dart';
import 'package:url_launcher/url_launcher.dart';

class ViewPurchaseOrderList implements PersistUI {
ViewPurchaseOrderList({this.force = false});
ViewPurchaseOrderList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewPurchaseOrder implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/quote/quote_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ import 'package:invoiceninja_flutter/data/web_client.dart';
import 'package:printing/printing.dart';

class ViewQuoteList implements PersistUI {
ViewQuoteList({this.force = false});
ViewQuoteList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewQuote implements PersistUI, PersistPrefs {
Expand Down
2 changes: 2 additions & 0 deletions lib/redux/recurring_expense/recurring_expense_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
class ViewRecurringExpenseList implements PersistUI {
ViewRecurringExpenseList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewRecurringExpense implements PersistUI, PersistPrefs {
Expand Down
2 changes: 2 additions & 0 deletions lib/redux/recurring_invoice/recurring_invoice_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
class ViewRecurringInvoiceList implements PersistUI {
ViewRecurringInvoiceList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewRecurringInvoice implements PersistUI, PersistPrefs {
Expand Down
3 changes: 2 additions & 1 deletion lib/redux/task/task_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import 'package:invoiceninja_flutter/utils/formatting.dart';
import 'package:invoiceninja_flutter/utils/localization.dart';

class ViewTaskList implements PersistUI {
ViewTaskList({this.force = false});
ViewTaskList({this.force = false, this.page = 0,});

final bool force;
final int page;
}

class ViewTask implements PersistUI, PersistPrefs {
Expand Down
6 changes: 5 additions & 1 deletion lib/redux/transaction/transaction_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import 'package:invoiceninja_flutter/utils/localization.dart';
import 'package:invoiceninja_flutter/ui/app/entities/entity_actions_dialog.dart';

class ViewTransactionList implements PersistUI {
ViewTransactionList({this.force = false});
ViewTransactionList({
this.force = false,
this.page = 0,
});

final bool force;
final int page;
}

class ViewTransaction implements PersistUI, PersistPrefs {
Expand Down
Loading

0 comments on commit f3dbf0b

Please sign in to comment.