diff --git a/lib/data/repositories/auth_repository.dart b/lib/data/repositories/auth_repository.dart index 6dc789a4e..0aa2c0387 100644 --- a/lib/data/repositories/auth_repository.dart +++ b/lib/data/repositories/auth_repository.dart @@ -165,6 +165,7 @@ class AuthRepository { return serializers.deserializeWith(LoginResponse.serializer, response); } - String get _tokenName => - kIsWeb ? 'web_client' : Platform.isAndroid ? 'android_client' : 'ios_client'; + String get _tokenName => kIsWeb + ? 'web_client' + : Platform.isAndroid ? 'android_client' : 'ios_client'; } diff --git a/lib/data/web_client.dart b/lib/data/web_client.dart index 76c3cb57a..100c1314c 100644 --- a/lib/data/web_client.dart +++ b/lib/data/web_client.dart @@ -176,7 +176,7 @@ void _checkResponse(http.Response response) { print('headers: ${response.headers}'); final version = response.headers['X-APP-VERSION']; - + /* if (version == null) { throw 'Invalid version, please check v5 is installed on the server'; diff --git a/lib/redux/client/client_reducer.dart b/lib/redux/client/client_reducer.dart index a063424ea..bc9ecfc6d 100644 --- a/lib/redux/client/client_reducer.dart +++ b/lib/redux/client/client_reducer.dart @@ -50,6 +50,7 @@ final selectedIdReducer = combineReducers([ return action.client.id; }), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => action.entityType == EntityType.client ? action.entityId : selectedId), ]); diff --git a/lib/redux/company_gateway/company_gateway_reducer.dart b/lib/redux/company_gateway/company_gateway_reducer.dart index f284cdb31..64df597a4 100644 --- a/lib/redux/company_gateway/company_gateway_reducer.dart +++ b/lib/redux/company_gateway/company_gateway_reducer.dart @@ -22,6 +22,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (String selectedId, action) => action.companyGateway.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/redux/credit/credit_reducer.dart b/lib/redux/credit/credit_reducer.dart index 09c05ef0f..3d44d8d3d 100644 --- a/lib/redux/credit/credit_reducer.dart +++ b/lib/redux/credit/credit_reducer.dart @@ -38,6 +38,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (selectedId, action) => action.credit.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/redux/design/design_reducer.dart b/lib/redux/design/design_reducer.dart index 9a2ba8542..20a7dcde5 100644 --- a/lib/redux/design/design_reducer.dart +++ b/lib/redux/design/design_reducer.dart @@ -21,6 +21,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (String selectedId, dynamic action) => action.design.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/redux/document/document_reducer.dart b/lib/redux/document/document_reducer.dart index 16b8bce09..29bfd4c3a 100644 --- a/lib/redux/document/document_reducer.dart +++ b/lib/redux/document/document_reducer.dart @@ -20,6 +20,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (selectedId, action) => action.document.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/redux/expense/expense_reducer.dart b/lib/redux/expense/expense_reducer.dart index e71b90b9f..7e9e9520d 100644 --- a/lib/redux/expense/expense_reducer.dart +++ b/lib/redux/expense/expense_reducer.dart @@ -20,6 +20,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (selectedId, action) => action.expense.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ @@ -315,5 +316,5 @@ ExpenseState _setLoadedExpenses( expenseState.loadExpenses(action.expenses); ExpenseState _setLoadedCompany( - ExpenseState expenseState, LoadCompanySuccess action) => + ExpenseState expenseState, LoadCompanySuccess action) => expenseState.loadExpenses(action.userCompany.company.expenses); diff --git a/lib/redux/group/group_reducer.dart b/lib/redux/group/group_reducer.dart index cd9f03adf..b1a4a7b2d 100644 --- a/lib/redux/group/group_reducer.dart +++ b/lib/redux/group/group_reducer.dart @@ -22,6 +22,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (String selectedId, action) => action.group.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => action.entityType == EntityType.group ? action.entityId : selectedId), ]); diff --git a/lib/redux/invoice/invoice_selectors.dart b/lib/redux/invoice/invoice_selectors.dart index 958550d4c..6c8ea4f5e 100644 --- a/lib/redux/invoice/invoice_selectors.dart +++ b/lib/redux/invoice/invoice_selectors.dart @@ -43,21 +43,23 @@ List dropdownInvoiceSelector( return list; } -var memoizedFilteredInvoiceList = memo5( - (BuiltMap invoiceMap, - BuiltList invoiceList, - BuiltMap clientMap, - BuiltMap paymentMap, - ListUIState invoiceListState,) => - filteredInvoicesSelector(invoiceMap, invoiceList, clientMap, paymentMap, - invoiceListState)); +var memoizedFilteredInvoiceList = memo5(( + BuiltMap invoiceMap, + BuiltList invoiceList, + BuiltMap clientMap, + BuiltMap paymentMap, + ListUIState invoiceListState, +) => + filteredInvoicesSelector( + invoiceMap, invoiceList, clientMap, paymentMap, invoiceListState)); List filteredInvoicesSelector( - BuiltMap invoiceMap, - BuiltList invoiceList, - BuiltMap clientMap, - BuiltMap paymentMap, - ListUIState invoiceListState,) { + BuiltMap invoiceMap, + BuiltList invoiceList, + BuiltMap clientMap, + BuiltMap paymentMap, + ListUIState invoiceListState, +) { final Map> invoicePaymentMap = {}; if (invoiceListState.filterEntityType == EntityType.payment) { diff --git a/lib/redux/payment/payment_reducer.dart b/lib/redux/payment/payment_reducer.dart index 2db37c867..dabaaf5bb 100644 --- a/lib/redux/payment/payment_reducer.dart +++ b/lib/redux/payment/payment_reducer.dart @@ -20,6 +20,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (selectedId, action) => action.payment.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => action.entityType == EntityType.payment ? action.entityId : selectedId), ]); diff --git a/lib/redux/payment_term/payment_term_reducer.dart b/lib/redux/payment_term/payment_term_reducer.dart index fca034f2b..7b7fdece1 100644 --- a/lib/redux/payment_term/payment_term_reducer.dart +++ b/lib/redux/payment_term/payment_term_reducer.dart @@ -21,6 +21,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (String selectedId, dynamic action) => action.paymentTerm.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ @@ -64,8 +65,7 @@ final paymentTermListReducer = combineReducers([ _filterPaymentTermsByCustom1), TypedReducer( _filterPaymentTermsByCustom2), - TypedReducer( - _filterPaymentTermsByClient), + TypedReducer(_filterPaymentTermsByClient), TypedReducer(_startListMultiselect), TypedReducer(_addToListMultiselect), TypedReducer( diff --git a/lib/redux/product/product_reducer.dart b/lib/redux/product/product_reducer.dart index 648de19e3..f4ed766ab 100644 --- a/lib/redux/product/product_reducer.dart +++ b/lib/redux/product/product_reducer.dart @@ -57,6 +57,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (selectedId, action) => action.product.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final productListReducer = combineReducers([ diff --git a/lib/redux/project/project_reducer.dart b/lib/redux/project/project_reducer.dart index 8105d66e6..6ba7cfb84 100644 --- a/lib/redux/project/project_reducer.dart +++ b/lib/redux/project/project_reducer.dart @@ -36,6 +36,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (selectedId, action) => action.project.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/redux/quote/quote_reducer.dart b/lib/redux/quote/quote_reducer.dart index 908a4c84b..bdfdd61af 100644 --- a/lib/redux/quote/quote_reducer.dart +++ b/lib/redux/quote/quote_reducer.dart @@ -37,6 +37,7 @@ Reducer selectedIdReducer = combineReducers([ (selectedId, action) => action.quote.id), TypedReducer((selectedId, action) => action.quote.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/redux/task/task_reducer.dart b/lib/redux/task/task_reducer.dart index 4693c6f86..a103b787e 100644 --- a/lib/redux/task/task_reducer.dart +++ b/lib/redux/task/task_reducer.dart @@ -29,6 +29,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer((selectedId, action) => action.taskId), TypedReducer((selectedId, action) => action.task.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ @@ -296,6 +297,5 @@ TaskState _setLoadedTask(TaskState taskState, LoadTaskSuccess action) { TaskState _setLoadedTasks(TaskState taskState, LoadTasksSuccess action) => taskState.loadTasks(action.tasks); -TaskState _setLoadedCompany( - TaskState taskState, LoadCompanySuccess action) => +TaskState _setLoadedCompany(TaskState taskState, LoadCompanySuccess action) => taskState.loadTasks(action.userCompany.company.tasks); diff --git a/lib/redux/tax_rate/tax_rate_reducer.dart b/lib/redux/tax_rate/tax_rate_reducer.dart index 216ed1bd8..b8af7e7a6 100644 --- a/lib/redux/tax_rate/tax_rate_reducer.dart +++ b/lib/redux/tax_rate/tax_rate_reducer.dart @@ -21,6 +21,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (String selectedId, action) => action.taxRate.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/redux/ui/ui_reducer.dart b/lib/redux/ui/ui_reducer.dart index 396d51db4..c2d0cb0dc 100644 --- a/lib/redux/ui/ui_reducer.dart +++ b/lib/redux/ui/ui_reducer.dart @@ -21,14 +21,10 @@ import 'package:invoiceninja_flutter/redux/project/project_reducer.dart'; import 'package:invoiceninja_flutter/redux/quote/quote_reducer.dart'; import 'package:invoiceninja_flutter/redux/task/task_reducer.dart'; import 'package:invoiceninja_flutter/redux/vendor/vendor_reducer.dart'; - // STARTER: import - do not remove comment import 'package:invoiceninja_flutter/redux/payment_term/payment_term_reducer.dart'; - import 'package:invoiceninja_flutter/redux/design/design_reducer.dart'; - import 'package:invoiceninja_flutter/redux/credit/credit_reducer.dart'; - import 'package:invoiceninja_flutter/redux/user/user_reducer.dart'; import 'package:invoiceninja_flutter/redux/tax_rate/tax_rate_reducer.dart'; import 'package:invoiceninja_flutter/redux/company_gateway/company_gateway_reducer.dart'; diff --git a/lib/redux/user/user_reducer.dart b/lib/redux/user/user_reducer.dart index d3249b631..6f40a6793 100644 --- a/lib/redux/user/user_reducer.dart +++ b/lib/redux/user/user_reducer.dart @@ -20,6 +20,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (String selectedId, action) => action.user.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => action.entityType == EntityType.user ? action.entityId : selectedId), ]); diff --git a/lib/redux/vendor/vendor_reducer.dart b/lib/redux/vendor/vendor_reducer.dart index 01e9f853b..dc00be37c 100644 --- a/lib/redux/vendor/vendor_reducer.dart +++ b/lib/redux/vendor/vendor_reducer.dart @@ -48,6 +48,7 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer( (selectedId, action) => action.vendor.id), TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([ diff --git a/lib/ui/app/actions_menu_button.dart b/lib/ui/app/actions_menu_button.dart index 733e81152..7cd2fff87 100644 --- a/lib/ui/app/actions_menu_button.dart +++ b/lib/ui/app/actions_menu_button.dart @@ -83,7 +83,6 @@ class ViewActionMenuButton extends StatelessWidget { entity: entity, onSelected: onSelected, isSaving: isSaving, - entityActions: entityActions - ); + entityActions: entityActions); } } diff --git a/lib/ui/app/lists/activity_list_tile.dart b/lib/ui/app/lists/activity_list_tile.dart index 42bc58b56..b52ff4d4d 100644 --- a/lib/ui/app/lists/activity_list_tile.dart +++ b/lib/ui/app/lists/activity_list_tile.dart @@ -42,7 +42,8 @@ class ActivityListTile extends StatelessWidget { onTap: !enableNavigation ? null : () { - print('## ON TAP: ${activity.entityType} - ${activity.invoiceId}'); + print( + '## ON TAP: ${activity.entityType} - ${activity.invoiceId}'); switch (activity.entityType) { case EntityType.task: viewEntityById( diff --git a/lib/ui/company_gateway/company_gateway_list_vm.dart b/lib/ui/company_gateway/company_gateway_list_vm.dart index d35bb7676..594468b20 100644 --- a/lib/ui/company_gateway/company_gateway_list_vm.dart +++ b/lib/ui/company_gateway/company_gateway_list_vm.dart @@ -81,8 +81,7 @@ class CompanyGatewayListVM { isLoading: state.isLoading, isLoaded: state.companyGatewayState.isLoaded, filter: state.companyGatewayUIState.listUIState.filter, - onClearEntityFilterPressed: () => - store.dispatch(ClearEntityFilter()), + onClearEntityFilterPressed: () => store.dispatch(ClearEntityFilter()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.companyGatewayListState.filterEntityId, diff --git a/lib/ui/credit/credit_list_item.dart b/lib/ui/credit/credit_list_item.dart index a087b90f5..3c560114b 100644 --- a/lib/ui/credit/credit_list_item.dart +++ b/lib/ui/credit/credit_list_item.dart @@ -225,7 +225,9 @@ class CreditListItem extends StatelessWidget { localization .lookup(kCreditStatuses[credit.statusId]), style: TextStyle( - color: !credit.isSent ? textColor : CreditStatusColors.colors[credit.statusId], + color: !credit.isSent + ? textColor + : CreditStatusColors.colors[credit.statusId], )), ], ), diff --git a/lib/ui/credit/credit_screen.dart b/lib/ui/credit/credit_screen.dart index 217e2816c..de8a3487a 100644 --- a/lib/ui/credit/credit_screen.dart +++ b/lib/ui/credit/credit_screen.dart @@ -124,22 +124,22 @@ class CreditScreen extends StatelessWidget { onSelectedCustom4: (value) => store.dispatch(FilterCreditsByCustom4(value)), ), - floatingActionButton: - state.prefState.isMenuFloated && userCompany.canCreate(EntityType.credit) - ? FloatingActionButton( - heroTag: 'credit_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () { - createEntityByType( - context: context, entityType: EntityType.credit); - }, - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.newCredit, - ) - : null, + floatingActionButton: state.prefState.isMenuFloated && + userCompany.canCreate(EntityType.credit) + ? FloatingActionButton( + heroTag: 'credit_fab', + backgroundColor: Theme.of(context).primaryColorDark, + onPressed: () { + createEntityByType( + context: context, entityType: EntityType.credit); + }, + child: Icon( + Icons.add, + color: Colors.white, + ), + tooltip: localization.newCredit, + ) + : null, ); } } diff --git a/lib/ui/design/design_presenter.dart b/lib/ui/design/design_presenter.dart index d9166d6a9..966fbf40d 100644 --- a/lib/ui/design/design_presenter.dart +++ b/lib/ui/design/design_presenter.dart @@ -3,11 +3,8 @@ import 'package:invoiceninja_flutter/data/models/models.dart'; import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart'; class DesignPresenter extends EntityPresenter { - static List getDefaultTableFields(UserCompanyEntity userCompany) { - return [ - - ]; + return []; } static List getAllTableFields(UserCompanyEntity userCompany) { diff --git a/lib/ui/document/document_list_vm.dart b/lib/ui/document/document_list_vm.dart index cb2ace440..813f36c24 100644 --- a/lib/ui/document/document_list_vm.dart +++ b/lib/ui/document/document_list_vm.dart @@ -119,8 +119,7 @@ class DocumentListVM { isLoading: state.isLoading, isLoaded: state.documentState.isLoaded, filter: state.documentUIState.listUIState.filter, - onClearEntityFilterPressed: () => - store.dispatch(FilterByEntity()), + onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.documentListState.filterEntityId, diff --git a/lib/ui/document/document_screen.dart b/lib/ui/document/document_screen.dart index 6c7373a8e..aa814740e 100644 --- a/lib/ui/document/document_screen.dart +++ b/lib/ui/document/document_screen.dart @@ -110,22 +110,22 @@ class DocumentScreen extends StatelessWidget { } }, ), - floatingActionButton: - state.prefState.isMenuFloated && userCompany.canCreate(EntityType.document) - ? FloatingActionButton( - heroTag: 'document_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () { - createEntityByType( - context: context, entityType: EntityType.document); - }, - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.newDocument, - ) - : null, + floatingActionButton: state.prefState.isMenuFloated && + userCompany.canCreate(EntityType.document) + ? FloatingActionButton( + heroTag: 'document_fab', + backgroundColor: Theme.of(context).primaryColorDark, + onPressed: () { + createEntityByType( + context: context, entityType: EntityType.document); + }, + child: Icon( + Icons.add, + color: Colors.white, + ), + tooltip: localization.newDocument, + ) + : null, ); } } diff --git a/lib/ui/expense/expense_list_vm.dart b/lib/ui/expense/expense_list_vm.dart index 2798026a0..33b5dfd74 100644 --- a/lib/ui/expense/expense_list_vm.dart +++ b/lib/ui/expense/expense_list_vm.dart @@ -135,8 +135,7 @@ class ExpenseListVM { isLoading: state.isLoading, isLoaded: state.expenseState.isLoaded, filter: state.expenseUIState.listUIState.filter, - onClearEntityFilterPressed: () => - store.dispatch(FilterByEntity()), + onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.expenseListState.filterEntityId, diff --git a/lib/ui/expense/expense_presenter.dart b/lib/ui/expense/expense_presenter.dart index a5e3e6782..558fcbab0 100644 --- a/lib/ui/expense/expense_presenter.dart +++ b/lib/ui/expense/expense_presenter.dart @@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart'; import 'package:invoiceninja_flutter/utils/formatting.dart'; class ExpensePresenter extends EntityPresenter { - static List getDefaultTableFields(UserCompanyEntity userCompany) { return [ ExpenseFields.vendor, diff --git a/lib/ui/expense/expense_screen.dart b/lib/ui/expense/expense_screen.dart index ef392177b..241eb4ce6 100644 --- a/lib/ui/expense/expense_screen.dart +++ b/lib/ui/expense/expense_screen.dart @@ -88,7 +88,8 @@ class ExpenseScreen extends StatelessWidget { bottomNavigationBar: AppBottomBar( entityType: EntityType.expense, tableColumns: ExpensePresenter.getAllTableFields(userCompany), - defaultTableColumns: ExpensePresenter.getDefaultTableFields(userCompany), + defaultTableColumns: + ExpensePresenter.getDefaultTableFields(userCompany), onRefreshPressed: () => store.dispatch(LoadExpenses(force: true)), onSelectedSortField: (value) => store.dispatch(SortExpenses(value)), customValues1: company.getCustomFieldValues(CustomFieldType.expense1, diff --git a/lib/ui/invoice/edit/invoice_edit_items_vm.dart b/lib/ui/invoice/edit/invoice_edit_items_vm.dart index aed9a7b4f..5ced091cd 100644 --- a/lib/ui/invoice/edit/invoice_edit_items_vm.dart +++ b/lib/ui/invoice/edit/invoice_edit_items_vm.dart @@ -82,7 +82,6 @@ class InvoiceEditItemsVM extends EntityEditItemsVM { ); factory InvoiceEditItemsVM.fromStore(Store store) { - return InvoiceEditItemsVM( state: store.state, company: store.state.company, diff --git a/lib/ui/invoice/invoice_list_item.dart b/lib/ui/invoice/invoice_list_item.dart index 16a1900fc..ffe4905c3 100644 --- a/lib/ui/invoice/invoice_list_item.dart +++ b/lib/ui/invoice/invoice_list_item.dart @@ -248,7 +248,8 @@ class InvoiceListItem extends StatelessWidget { ), Text(statusLabel, style: TextStyle( - color: !invoice.isSent ? textColor : statusColor, + color: + !invoice.isSent ? textColor : statusColor, )), ], ), diff --git a/lib/ui/invoice/invoice_list_vm.dart b/lib/ui/invoice/invoice_list_vm.dart index 85590f942..c15b7ef39 100644 --- a/lib/ui/invoice/invoice_list_vm.dart +++ b/lib/ui/invoice/invoice_list_vm.dart @@ -186,11 +186,11 @@ class InvoiceListVM extends EntityListVM { user: state.user, listState: state.invoiceListState, invoiceList: memoizedFilteredInvoiceList( - state.invoiceState.map, - state.invoiceState.list, - state.clientState.map, - state.paymentState.map, - state.invoiceListState, + state.invoiceState.map, + state.invoiceState.list, + state.clientState.map, + state.paymentState.map, + state.invoiceListState, ), invoiceMap: state.invoiceState.map, clientMap: state.clientState.map, @@ -206,8 +206,7 @@ class InvoiceListVM extends EntityListVM { } }, onRefreshed: (context) => _handleRefresh(context), - onClearEntityFilterPressed: () => - store.dispatch(FilterByEntity()), + onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.invoiceListState.filterEntityId, diff --git a/lib/ui/invoice/invoice_screen.dart b/lib/ui/invoice/invoice_screen.dart index eee7accfa..31bf8d084 100644 --- a/lib/ui/invoice/invoice_screen.dart +++ b/lib/ui/invoice/invoice_screen.dart @@ -88,7 +88,8 @@ class InvoiceScreen extends StatelessWidget { bottomNavigationBar: AppBottomBar( entityType: EntityType.invoice, tableColumns: InvoicePresenter.getAllTableFields(userCompany), - defaultTableColumns: InvoicePresenter.getDefaultTableFields(userCompany), + defaultTableColumns: + InvoicePresenter.getDefaultTableFields(userCompany), onRefreshPressed: () => store.dispatch(LoadInvoices(force: true)), onSelectedSortField: (value) { store.dispatch(SortInvoices(value)); diff --git a/lib/ui/payment/payment_list_vm.dart b/lib/ui/payment/payment_list_vm.dart index 6ec7bfa3d..45c0551d6 100644 --- a/lib/ui/payment/payment_list_vm.dart +++ b/lib/ui/payment/payment_list_vm.dart @@ -139,8 +139,7 @@ class PaymentListVM { viewEntity(context: context, entity: payment); } }, - onClearEntityFilterPressed: () => - store.dispatch(FilterByEntity()), + onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.paymentListState.filterEntityId, diff --git a/lib/ui/payment/payment_screen.dart b/lib/ui/payment/payment_screen.dart index a182e4b31..34cead0a6 100644 --- a/lib/ui/payment/payment_screen.dart +++ b/lib/ui/payment/payment_screen.dart @@ -84,7 +84,8 @@ class PaymentScreen extends StatelessWidget { bottomNavigationBar: AppBottomBar( entityType: EntityType.payment, tableColumns: PaymentPresenter.getAllTableFields(userCompany), - defaultTableColumns: PaymentPresenter.getDefaultTableFields(userCompany), + defaultTableColumns: + PaymentPresenter.getDefaultTableFields(userCompany), onRefreshPressed: () => store.dispatch(LoadPayments(force: true)), onSelectedSortField: (value) => store.dispatch(SortPayments(value)), customValues1: company.getCustomFieldValues(CustomFieldType.payment1, diff --git a/lib/ui/payment_term/payment_term_list_vm.dart b/lib/ui/payment_term/payment_term_list_vm.dart index 4b9a60363..95975596d 100644 --- a/lib/ui/payment_term/payment_term_list_vm.dart +++ b/lib/ui/payment_term/payment_term_list_vm.dart @@ -125,8 +125,7 @@ class PaymentTermListVM { isLoading: state.isLoading, isLoaded: state.paymentTermState.isLoaded, filter: state.paymentTermUIState.listUIState.filter, - onClearEntityFilterPressed: () => - store.dispatch(FilterByEntity()), + onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.paymentTermListState.filterEntityId, diff --git a/lib/ui/payment_term/payment_term_presenter.dart b/lib/ui/payment_term/payment_term_presenter.dart index 859cfe6b8..d030c5213 100644 --- a/lib/ui/payment_term/payment_term_presenter.dart +++ b/lib/ui/payment_term/payment_term_presenter.dart @@ -3,11 +3,8 @@ import 'package:invoiceninja_flutter/data/models/models.dart'; import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart'; class PaymentTermPresenter extends EntityPresenter { - static List getDefaultTableFields(UserCompanyEntity userCompany) { - return [ - - ]; + return []; } static List getAllTableFields(UserCompanyEntity userCompany) { diff --git a/lib/ui/product/product_screen.dart b/lib/ui/product/product_screen.dart index 652f60f09..a0e29dc1c 100644 --- a/lib/ui/product/product_screen.dart +++ b/lib/ui/product/product_screen.dart @@ -84,7 +84,8 @@ class ProductScreen extends StatelessWidget { bottomNavigationBar: AppBottomBar( entityType: EntityType.product, tableColumns: ProductPresenter.getAllTableFields(userCompany), - defaultTableColumns: ProductPresenter.getDefaultTableFields(userCompany), + defaultTableColumns: + ProductPresenter.getDefaultTableFields(userCompany), onRefreshPressed: () => store.dispatch(LoadProducts(force: true)), onSelectedSortField: (value) => store.dispatch(SortProducts(value)), customValues1: company.getCustomFieldValues(CustomFieldType.product1, @@ -119,22 +120,22 @@ class ProductScreen extends StatelessWidget { } }, ), - floatingActionButton: - state.prefState.isMenuFloated && userCompany.canCreate(EntityType.product) - ? FloatingActionButton( - heroTag: 'product_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () { - createEntityByType( - context: context, entityType: EntityType.product); - }, - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.newProduct, - ) - : null, + floatingActionButton: state.prefState.isMenuFloated && + userCompany.canCreate(EntityType.product) + ? FloatingActionButton( + heroTag: 'product_fab', + backgroundColor: Theme.of(context).primaryColorDark, + onPressed: () { + createEntityByType( + context: context, entityType: EntityType.product); + }, + child: Icon( + Icons.add, + color: Colors.white, + ), + tooltip: localization.newProduct, + ) + : null, ); } } diff --git a/lib/ui/project/project_list_vm.dart b/lib/ui/project/project_list_vm.dart index e85b868d7..506468393 100644 --- a/lib/ui/project/project_list_vm.dart +++ b/lib/ui/project/project_list_vm.dart @@ -129,8 +129,7 @@ class ProjectListVM { isLoading: state.isLoading, isLoaded: state.projectState.isLoaded, filter: state.projectUIState.listUIState.filter, - onClearEntityFilterPressed: () => - store.dispatch(ClearEntityFilter()), + onClearEntityFilterPressed: () => store.dispatch(ClearEntityFilter()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.projectListState.filterEntityId, diff --git a/lib/ui/project/project_presenter.dart b/lib/ui/project/project_presenter.dart index dc0167180..3074fa865 100644 --- a/lib/ui/project/project_presenter.dart +++ b/lib/ui/project/project_presenter.dart @@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart'; import 'package:invoiceninja_flutter/utils/formatting.dart'; class ProjectPresenter extends EntityPresenter { - static List getDefaultTableFields(UserCompanyEntity userCompany) { return [ ProjectFields.name, diff --git a/lib/ui/project/project_screen.dart b/lib/ui/project/project_screen.dart index 676cf8393..174343c39 100644 --- a/lib/ui/project/project_screen.dart +++ b/lib/ui/project/project_screen.dart @@ -86,7 +86,8 @@ class ProjectScreen extends StatelessWidget { bottomNavigationBar: AppBottomBar( entityType: EntityType.project, tableColumns: ProjectPresenter.getAllTableFields(userCompany), - defaultTableColumns: ProjectPresenter.getDefaultTableFields(userCompany), + defaultTableColumns: + ProjectPresenter.getDefaultTableFields(userCompany), onRefreshPressed: () => store.dispatch(LoadProjects(force: true)), onSelectedSortField: (value) => store.dispatch(SortProjects(value)), customValues1: company.getCustomFieldValues(CustomFieldType.project1, @@ -120,20 +121,20 @@ class ProjectScreen extends StatelessWidget { } }, ), - floatingActionButton: - state.prefState.isMenuFloated && userCompany.canCreate(EntityType.project) - ? FloatingActionButton( - heroTag: 'project_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () => createEntityByType( - context: context, entityType: EntityType.project), - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.newProject, - ) - : null, + floatingActionButton: state.prefState.isMenuFloated && + userCompany.canCreate(EntityType.project) + ? FloatingActionButton( + heroTag: 'project_fab', + backgroundColor: Theme.of(context).primaryColorDark, + onPressed: () => createEntityByType( + context: context, entityType: EntityType.project), + child: Icon( + Icons.add, + color: Colors.white, + ), + tooltip: localization.newProject, + ) + : null, ); } } diff --git a/lib/ui/quote/quote_screen.dart b/lib/ui/quote/quote_screen.dart index 24ef828d4..8724a714a 100644 --- a/lib/ui/quote/quote_screen.dart +++ b/lib/ui/quote/quote_screen.dart @@ -149,22 +149,22 @@ class QuoteScreen extends StatelessWidget { } }, ), - floatingActionButton: - state.prefState.isMenuFloated && userCompany.canCreate(EntityType.quote) - ? FloatingActionButton( - heroTag: 'quote_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () { - createEntityByType( - context: context, entityType: EntityType.quote); - }, - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.newQuote, - ) - : null, + floatingActionButton: state.prefState.isMenuFloated && + userCompany.canCreate(EntityType.quote) + ? FloatingActionButton( + heroTag: 'quote_fab', + backgroundColor: Theme.of(context).primaryColorDark, + onPressed: () { + createEntityByType( + context: context, entityType: EntityType.quote); + }, + child: Icon( + Icons.add, + color: Colors.white, + ), + tooltip: localization.newQuote, + ) + : null, ); } } diff --git a/lib/ui/settings/account_management.dart b/lib/ui/settings/account_management.dart index 651b2c21a..21e35a978 100644 --- a/lib/ui/settings/account_management.dart +++ b/lib/ui/settings/account_management.dart @@ -170,7 +170,8 @@ class _AccountOverview extends StatelessWidget { callback: (value) { final state = viewModel.state; final credentials = state.credentials; - final url = '${credentials.url}/claim_license?license_key=$value'; + final url = + '${credentials.url}/claim_license?license_key=$value'; WebClient() .post( url, diff --git a/lib/ui/task/task_presenter.dart b/lib/ui/task/task_presenter.dart index 06ebbe16a..1dd712403 100644 --- a/lib/ui/task/task_presenter.dart +++ b/lib/ui/task/task_presenter.dart @@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart'; import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart'; class TaskPresenter extends EntityPresenter { - static List getDefaultTableFields(UserCompanyEntity userCompany) { return [ TaskFields.client, diff --git a/lib/ui/tax_rate/tax_rate_list_vm.dart b/lib/ui/tax_rate/tax_rate_list_vm.dart index f87f68126..a0d972313 100644 --- a/lib/ui/tax_rate/tax_rate_list_vm.dart +++ b/lib/ui/tax_rate/tax_rate_list_vm.dart @@ -120,8 +120,7 @@ class TaxRateListVM { isLoading: state.isLoading, isLoaded: state.taxRateState.isLoaded, filter: state.taxRateUIState.listUIState.filter, - onClearEntityFilterPressed: () => - store.dispatch(ClearEntityFilter()), + onClearEntityFilterPressed: () => store.dispatch(ClearEntityFilter()), onViewEntityFilterPressed: (BuildContext context) => viewEntityById( context: context, entityId: state.taxRateListState.filterEntityId, diff --git a/lib/ui/vendor/vendor_presenter.dart b/lib/ui/vendor/vendor_presenter.dart index acab85f82..04c8d92d3 100644 --- a/lib/ui/vendor/vendor_presenter.dart +++ b/lib/ui/vendor/vendor_presenter.dart @@ -3,7 +3,6 @@ import 'package:invoiceninja_flutter/data/models/models.dart'; import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart'; class VendorPresenter extends EntityPresenter { - static List getDefaultTableFields(UserCompanyEntity userCompany) { return [ VendorFields.name, diff --git a/lib/ui/vendor/vendor_screen.dart b/lib/ui/vendor/vendor_screen.dart index 81d7807ba..f5e95b530 100644 --- a/lib/ui/vendor/vendor_screen.dart +++ b/lib/ui/vendor/vendor_screen.dart @@ -120,22 +120,22 @@ class VendorScreen extends StatelessWidget { } }, ), - floatingActionButton: - state.prefState.isMenuFloated && userCompany.canCreate(EntityType.vendor) - ? FloatingActionButton( - heroTag: 'vendor_fab', - backgroundColor: Theme.of(context).primaryColorDark, - onPressed: () { - createEntityByType( - context: context, entityType: EntityType.vendor); - }, - child: Icon( - Icons.add, - color: Colors.white, - ), - tooltip: localization.newVendor, - ) - : null, + floatingActionButton: state.prefState.isMenuFloated && + userCompany.canCreate(EntityType.vendor) + ? FloatingActionButton( + heroTag: 'vendor_fab', + backgroundColor: Theme.of(context).primaryColorDark, + onPressed: () { + createEntityByType( + context: context, entityType: EntityType.vendor); + }, + child: Icon( + Icons.add, + color: Colors.white, + ), + tooltip: localization.newVendor, + ) + : null, ); } } diff --git a/lib/utils/completers.dart b/lib/utils/completers.dart index 553fb74be..667f9df27 100644 --- a/lib/utils/completers.dart +++ b/lib/utils/completers.dart @@ -37,7 +37,6 @@ Completer snackBarCompleter(BuildContext context, String message, // } - completer.future.then((_) { if (shouldPop) { Navigator.of(context).pop(); @@ -45,8 +44,8 @@ Completer snackBarCompleter(BuildContext context, String message, if (scaffold != null) { scaffold.showSnackBar(SnackBar( content: SnackBarRow( - message: message, - ))); + message: message, + ))); } }).catchError((Object error) { if (shouldPop) { diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index 42d838672..05d031c2d 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -3891,20 +3891,16 @@ mixin LocalizationsProvider on LocaleCodeAware { String get reminderEndless => _localizedValues[localeCode]['reminder_endless'] ?? ''; - String get useDefault => - _localizedValues[localeCode]['use_default'] ?? ''; + String get useDefault => _localizedValues[localeCode]['use_default'] ?? ''; - String get contactName => - _localizedValues[localeCode]['contact_name'] ?? ''; + String get contactName => _localizedValues[localeCode]['contact_name'] ?? ''; String get creditRemaining => _localizedValues[localeCode]['credit_remaining'] ?? ''; - String get allRecords => - _localizedValues[localeCode]['all_records'] ?? ''; + String get allRecords => _localizedValues[localeCode]['all_records'] ?? ''; - String get ownedByUser => - _localizedValues[localeCode]['owned_by_user'] ?? ''; + String get ownedByUser => _localizedValues[localeCode]['owned_by_user'] ?? ''; String lookup(String key) { final lookupKey = toSnakeCase(key); diff --git a/lib/utils/platforms.dart b/lib/utils/platforms.dart index ff6d3f496..c8163b843 100644 --- a/lib/utils/platforms.dart +++ b/lib/utils/platforms.dart @@ -40,7 +40,6 @@ String getAppURL(BuildContext context) { } } - AppLayout calculateLayout(BuildContext context) { final size = MediaQuery.of(context).size.width; diff --git a/stubs/redux/stub/stub_reducer b/stubs/redux/stub/stub_reducer index ba0c8a57b..f45037efd 100644 --- a/stubs/redux/stub/stub_reducer +++ b/stubs/redux/stub/stub_reducer @@ -22,7 +22,8 @@ Reducer selectedIdReducer = combineReducers([ (String selectedId, dynamic action) => action.stubId), TypedReducer( (String selectedId, dynamic action) => action.stub.id), - TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), + TypedReducer((selectedId, action) => ''), ]); final editingReducer = combineReducers([