diff --git a/lib/data/models/company_model.dart b/lib/data/models/company_model.dart index 39d84f3de..34d603cbe 100644 --- a/lib/data/models/company_model.dart +++ b/lib/data/models/company_model.dart @@ -964,7 +964,8 @@ abstract class GatewayEntity extends Object } } - static String? getPaymentUrl({String? gatewayId, String? transactionReference}) { + static String? getPaymentUrl( + {String? gatewayId, String? transactionReference}) { switch (gatewayId) { case kGatewayStripe: case kGatewayStripeConnect: diff --git a/lib/data/models/design_model.dart b/lib/data/models/design_model.dart index 405f85123..560f07544 100644 --- a/lib/data/models/design_model.dart +++ b/lib/data/models/design_model.dart @@ -90,7 +90,8 @@ abstract class DesignEntity extends Object {String? id, AppState? state, BuiltMap? design}) { if (design == null && state != null) { final designMap = state.designState.map; - design = designMap[state.company!.settings.defaultInvoiceDesignId]?.design; + design = + designMap[state.company!.settings.defaultInvoiceDesignId]?.design; } return _$DesignEntity._( diff --git a/lib/data/models/project_model.dart b/lib/data/models/project_model.dart index e560c0e0b..31d26e3fd 100644 --- a/lib/data/models/project_model.dart +++ b/lib/data/models/project_model.dart @@ -220,8 +220,9 @@ abstract class ProjectEntity extends Object switch (sortField) { case ProjectFields.name: - response = - projectA!.name.toLowerCase().compareTo(projectB!.name.toLowerCase()); + response = projectA!.name + .toLowerCase() + .compareTo(projectB!.name.toLowerCase()); break; case ProjectFields.taskRate: response = projectA!.taskRate.compareTo(projectB!.taskRate); diff --git a/lib/data/models/tax_rate_model.dart b/lib/data/models/tax_rate_model.dart index 0756ded67..913ef801b 100644 --- a/lib/data/models/tax_rate_model.dart +++ b/lib/data/models/tax_rate_model.dart @@ -56,7 +56,8 @@ class TaxRateFields { abstract class TaxRateEntity extends Object with BaseEntity, SelectableEntity implements Built { - factory TaxRateEntity({String? id, String? name, double? rate, AppState? state}) { + factory TaxRateEntity( + {String? id, String? name, double? rate, AppState? state}) { return _$TaxRateEntity._( id: BaseEntity.nextId, isChanged: false, @@ -100,8 +101,9 @@ abstract class TaxRateEntity extends Object switch (sortField) { case TaxRateFields.name: - response = - taxRateA!.name.toLowerCase().compareTo(taxRateB!.name.toLowerCase()); + response = taxRateA!.name + .toLowerCase() + .compareTo(taxRateB!.name.toLowerCase()); break; case TaxRateFields.rate: response = taxRateA!.rate.compareTo(taxRateB!.rate); diff --git a/lib/data/models/widget_model.dart b/lib/data/models/widget_model.dart index 8546447ea..fe14f04b2 100644 --- a/lib/data/models/widget_model.dart +++ b/lib/data/models/widget_model.dart @@ -40,7 +40,8 @@ class WidgetData { dateRanges = Map.fromIterable( DateRange.values.where((value) => value != DateRange.custom), key: (dynamic item) => toSnakeCase('$item'), - value: (dynamic item) => localization!.lookup(toSnakeCase('$item'))); + value: (dynamic item) => + localization!.lookup(toSnakeCase('$item'))); WidgetData.fromJson(Map json) : url = json['url'], diff --git a/lib/data/repositories/group_repository.dart b/lib/data/repositories/group_repository.dart index aa1e1831b..0f91b9b14 100644 --- a/lib/data/repositories/group_repository.dart +++ b/lib/data/repositories/group_repository.dart @@ -21,7 +21,8 @@ class GroupRepository { final WebClient webClient; - Future loadItem(Credentials credentials, String? entityId) async { + Future loadItem( + Credentials credentials, String? entityId) async { final dynamic response = await webClient.get( '${credentials.url}/group_settings/$entityId', credentials.token); diff --git a/lib/data/repositories/tax_rate_repository.dart b/lib/data/repositories/tax_rate_repository.dart index eecca8e9b..3a911f234 100644 --- a/lib/data/repositories/tax_rate_repository.dart +++ b/lib/data/repositories/tax_rate_repository.dart @@ -47,8 +47,8 @@ class TaxRateRepository { ids = ids.sublist(0, kMaxEntitiesPerBulkAction); } - final url = - credentials.url! + '/tax_rates/bulk?per_page=$kMaxEntitiesPerBulkAction'; + final url = credentials.url! + + '/tax_rates/bulk?per_page=$kMaxEntitiesPerBulkAction'; final dynamic response = await webClient.post(url, credentials.token, data: json.encode({'ids': ids, 'action': action.toApiParam()})); diff --git a/lib/data/repositories/token_repository.dart b/lib/data/repositories/token_repository.dart index 7280b368e..4712ab399 100644 --- a/lib/data/repositories/token_repository.dart +++ b/lib/data/repositories/token_repository.dart @@ -19,7 +19,8 @@ class TokenRepository { final WebClient webClient; - Future loadItem(Credentials credentials, String? entityId) async { + Future loadItem( + Credentials credentials, String? entityId) async { final dynamic response = await webClient.get( '${credentials.url}/tokens/$entityId', credentials.token); diff --git a/lib/redux/bank_account/bank_account_reducer.dart b/lib/redux/bank_account/bank_account_reducer.dart index b00bce63f..e6040a809 100644 --- a/lib/redux/bank_account/bank_account_reducer.dart +++ b/lib/redux/bank_account/bank_account_reducer.dart @@ -22,10 +22,14 @@ final forceSelectedReducer = combineReducers([ TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), ]); final int? Function(int, dynamic) tabIndexReducer = combineReducers([ @@ -54,10 +58,14 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), TypedReducer( (selectedId, action) => action.clearSelection ? '' @@ -88,7 +96,8 @@ final editingReducer = combineReducers([ TypedReducer(_clearEditing), ]); -BankAccountEntity _clearEditing(BankAccountEntity? bankAccount, dynamic action) { +BankAccountEntity _clearEditing( + BankAccountEntity? bankAccount, dynamic action) { return BankAccountEntity(); } diff --git a/lib/redux/client/client_reducer.dart b/lib/redux/client/client_reducer.dart index be072df65..8b261e15e 100644 --- a/lib/redux/client/client_reducer.dart +++ b/lib/redux/client/client_reducer.dart @@ -24,7 +24,9 @@ EntityUIState clientUIReducer(ClientUIState state, dynamic action) { ..forceSelected = forceSelectedReducer(state.forceSelected, action) ..tabIndex = tabIndexReducer(state.tabIndex, action) ..saveCompleter = saveCompleterReducer(state.saveCompleter, action) - ..cancelCompleter = cancelCompleterReducer(state.cancelCompleter as Completer?, action) as Completer?); + ..cancelCompleter = cancelCompleterReducer( + state.cancelCompleter as Completer?, action) + as Completer?); } final forceSelectedReducer = combineReducers([ @@ -79,7 +81,8 @@ final selectedIdReducer = combineReducers([ TypedReducer((selectedId, action) { return action.client.id; }), - TypedReducer((selectedId, action) => action.client!.id), + TypedReducer( + (selectedId, action) => action.client!.id), TypedReducer( (selectedId, action) => action.clearSelection ? '' : selectedId), TypedReducer((selectedId, action) => ''), diff --git a/lib/redux/company/company_selectors.dart b/lib/redux/company/company_selectors.dart index 9e9c1bb1c..0a0de2807 100644 --- a/lib/redux/company/company_selectors.dart +++ b/lib/redux/company/company_selectors.dart @@ -78,8 +78,8 @@ List getCurrencyIds( } } -var memoizedFilteredSelector = memo2( - (String? filter, UserCompanyState state) => filteredSelector(filter, state)); +var memoizedFilteredSelector = memo2((String? filter, UserCompanyState state) => + filteredSelector(filter, state)); List filteredSelector(String? filter, UserCompanyState state) { final List list = [] diff --git a/lib/redux/company_gateway/company_gateway_reducer.dart b/lib/redux/company_gateway/company_gateway_reducer.dart index 223da1231..afdb3b189 100644 --- a/lib/redux/company_gateway/company_gateway_reducer.dart +++ b/lib/redux/company_gateway/company_gateway_reducer.dart @@ -38,7 +38,8 @@ final forceSelectedReducer = combineReducers([ ]); Reducer selectedIdReducer = combineReducers([ - TypedReducer((completer, action) => ''), + TypedReducer( + (completer, action) => ''), TypedReducer((completer, action) => ''), TypedReducer((selectedId, action) => action.entityType == EntityType.companyGateway @@ -72,7 +73,8 @@ Reducer selectedIdReducer = combineReducers([ ]); final editingReducer = combineReducers([ - TypedReducer(_updateEditing), + TypedReducer( + _updateEditing), TypedReducer(_updateEditing), TypedReducer( (companyGateways, action) { diff --git a/lib/redux/credit/credit_middleware.dart b/lib/redux/credit/credit_middleware.dart index 0c06bdb07..38943cda5 100644 --- a/lib/redux/credit/credit_middleware.dart +++ b/lib/redux/credit/credit_middleware.dart @@ -123,7 +123,9 @@ Middleware _showEmailCredit() { final emailWasSent = await navigatorKey.currentState!.pushNamed(CreditEmailScreen.route); - if (action!.completer != null && emailWasSent != null && emailWasSent as bool) { + if (action!.completer != null && + emailWasSent != null && + emailWasSent as bool) { action.completer!.complete(null); } } diff --git a/lib/redux/design/design_selectors.dart b/lib/redux/design/design_selectors.dart index ec8b80d4b..d6cc24c67 100644 --- a/lib/redux/design/design_selectors.dart +++ b/lib/redux/design/design_selectors.dart @@ -65,7 +65,9 @@ List filteredDesignsSelector(BuiltMap designMap, } String? getDesignIdForClientByEntity( - {required AppState state, required String clientId, EntityType? entityType}) { + {required AppState state, + required String clientId, + EntityType? entityType}) { final client = state.clientState.get(clientId); final settings = getClientSettings(state, client); switch (entityType) { @@ -82,7 +84,9 @@ String? getDesignIdForClientByEntity( } String? getDesignIdForVendorByEntity( - {required AppState state, required String vendorId, EntityType? entityType}) { + {required AppState state, + required String vendorId, + EntityType? entityType}) { final vendor = state.vendorState.get(vendorId); final settings = getVendorSettings(state, vendor); diff --git a/lib/redux/document/document_middleware.dart b/lib/redux/document/document_middleware.dart index 3e33916d3..645dc8b55 100644 --- a/lib/redux/document/document_middleware.dart +++ b/lib/redux/document/document_middleware.dart @@ -307,4 +307,4 @@ Middleware _loadDocuments(DocumentRepository repository) { next(action); }; } -*/ \ No newline at end of file +*/ diff --git a/lib/redux/expense_category/expense_category_reducer.dart b/lib/redux/expense_category/expense_category_reducer.dart index 18093ad8b..340fca210 100644 --- a/lib/redux/expense_category/expense_category_reducer.dart +++ b/lib/redux/expense_category/expense_category_reducer.dart @@ -21,7 +21,9 @@ EntityUIState expenseCategoryUIReducer( ..selectedId = selectedIdReducer(state.selectedId, action) ..forceSelected = forceSelectedReducer(state.forceSelected, action) ..saveCompleter = saveCompleterReducer(state.saveCompleter, action) - ..cancelCompleter = cancelCompleterReducer(state.cancelCompleter as Completer?, action) as Completer?); + ..cancelCompleter = cancelCompleterReducer( + state.cancelCompleter as Completer?, action) + as Completer?); } final saveCompleterReducer = combineReducers?>([ diff --git a/lib/redux/group/group_reducer.dart b/lib/redux/group/group_reducer.dart index 4086230a8..e326d1881 100644 --- a/lib/redux/group/group_reducer.dart +++ b/lib/redux/group/group_reducer.dart @@ -137,7 +137,8 @@ ListUIState _addToListMultiselect( ListUIState _removeFromListMultiselect( ListUIState groupListState, RemoveFromGroupMultiselect action) { - return groupListState.rebuild((b) => b..selectedIds.remove(action.entity!.id)); + return groupListState + .rebuild((b) => b..selectedIds.remove(action.entity!.id)); } ListUIState _clearListMultiselect( diff --git a/lib/redux/invoice/invoice_middleware.dart b/lib/redux/invoice/invoice_middleware.dart index e8d34584a..7e812ff19 100644 --- a/lib/redux/invoice/invoice_middleware.dart +++ b/lib/redux/invoice/invoice_middleware.dart @@ -128,7 +128,9 @@ Middleware _showEmailInvoice() { final emailWasSent = await navigatorKey.currentState!.pushNamed(InvoiceEmailScreen.route); - if (action!.completer != null && emailWasSent != null && emailWasSent as bool) { + if (action!.completer != null && + emailWasSent != null && + emailWasSent as bool) { action.completer!.complete(null); } } diff --git a/lib/redux/payment_term/payment_term_reducer.dart b/lib/redux/payment_term/payment_term_reducer.dart index 6427c9839..386e27dac 100644 --- a/lib/redux/payment_term/payment_term_reducer.dart +++ b/lib/redux/payment_term/payment_term_reducer.dart @@ -25,10 +25,14 @@ final forceSelectedReducer = combineReducers([ TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), ]); Reducer selectedIdReducer = combineReducers([ @@ -48,10 +52,14 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), ]); final editingReducer = combineReducers([ @@ -76,7 +84,8 @@ final editingReducer = combineReducers([ TypedReducer(_clearEditing), ]); -PaymentTermEntity _clearEditing(PaymentTermEntity? paymentTerm, dynamic action) { +PaymentTermEntity _clearEditing( + PaymentTermEntity? paymentTerm, dynamic action) { return PaymentTermEntity(); } diff --git a/lib/redux/product/product_selectors.dart b/lib/redux/product/product_selectors.dart index 73b507c75..e9090e624 100644 --- a/lib/redux/product/product_selectors.dart +++ b/lib/redux/product/product_selectors.dart @@ -42,8 +42,8 @@ InvoiceItemEntity convertProductToInvoiceItem({ if (!company.convertRateToClient && exchangeRate != 0) { exchangeRate = 1 / exchangeRate; } - cost = - round(cost * exchangeRate, currencyMap[client!.currencyId]!.precision); + cost = round( + cost * exchangeRate, currencyMap[client!.currencyId]!.precision); } return InvoiceItemEntity().rebuild((b) => b @@ -69,7 +69,8 @@ InvoiceItemEntity convertProductToInvoiceItem({ } var memoizedDropdownProductList = memo3( - (BuiltMap productMap, BuiltList productList, + (BuiltMap productMap, + BuiltList productList, BuiltMap userMap) => dropdownProductsSelector(productMap, productList, userMap)); @@ -77,8 +78,9 @@ List dropdownProductsSelector( BuiltMap productMap, BuiltList productList, BuiltMap userMap) { - final list = - productList.where((productId) => productMap[productId]!.isActive).toList(); + final list = productList + .where((productId) => productMap[productId]!.isActive) + .toList(); list.sort((productAId, productBId) { final productA = productMap[productAId]!; diff --git a/lib/redux/project/project_reducer.dart b/lib/redux/project/project_reducer.dart index cd61e2485..c7fde0733 100644 --- a/lib/redux/project/project_reducer.dart +++ b/lib/redux/project/project_reducer.dart @@ -23,7 +23,9 @@ EntityUIState projectUIReducer(ProjectUIState state, dynamic action) { ..forceSelected = forceSelectedReducer(state.forceSelected, action) ..tabIndex = tabIndexReducer(state.tabIndex, action) ..saveCompleter = saveCompleterReducer(state.saveCompleter, action) - ..cancelCompleter = cancelCompleterReducer(state.cancelCompleter as Completer?, action) as Completer?); + ..cancelCompleter = cancelCompleterReducer( + state.cancelCompleter as Completer?, action) + as Completer?); } final forceSelectedReducer = combineReducers([ diff --git a/lib/redux/purchase_order/purchase_order_middleware.dart b/lib/redux/purchase_order/purchase_order_middleware.dart index ce34216da..b029e7f14 100644 --- a/lib/redux/purchase_order/purchase_order_middleware.dart +++ b/lib/redux/purchase_order/purchase_order_middleware.dart @@ -144,7 +144,9 @@ Middleware _showEmailPurchaseOrder() { final emailWasSent = await navigatorKey.currentState! .pushNamed(PurchaseOrderEmailScreen.route); - if (action!.completer != null && emailWasSent != null && emailWasSent as bool) { + if (action!.completer != null && + emailWasSent != null && + emailWasSent as bool) { action.completer!.complete(null); } } diff --git a/lib/redux/quote/quote_middleware.dart b/lib/redux/quote/quote_middleware.dart index d0be438e8..ad58e8e9b 100644 --- a/lib/redux/quote/quote_middleware.dart +++ b/lib/redux/quote/quote_middleware.dart @@ -128,7 +128,9 @@ Middleware _showEmailQuote() { final emailWasSent = await navigatorKey.currentState!.pushNamed(QuoteEmailScreen.route); - if (action!.completer != null && emailWasSent != null && emailWasSent as bool) { + if (action!.completer != null && + emailWasSent != null && + emailWasSent as bool) { action.completer!.complete(null); } } diff --git a/lib/redux/recurring_invoice/recurring_invoice_middleware.dart b/lib/redux/recurring_invoice/recurring_invoice_middleware.dart index 6e0eec68c..79e348022 100644 --- a/lib/redux/recurring_invoice/recurring_invoice_middleware.dart +++ b/lib/redux/recurring_invoice/recurring_invoice_middleware.dart @@ -200,7 +200,8 @@ Middleware _updatePricesRecurringInvoice( } }).catchError((Object error) { print(error); - store.dispatch(UpdatePricesRecurringInvoicesFailure(error as List)); + store.dispatch( + UpdatePricesRecurringInvoicesFailure(error as List)); if (action.completer != null) { action.completer!.completeError(error); } @@ -225,7 +226,8 @@ Middleware _increasePricesRecurringInvoice( } }).catchError((Object error) { print(error); - store.dispatch(IncreasePricesRecurringInvoicesFailure(error as List)); + store.dispatch( + IncreasePricesRecurringInvoicesFailure(error as List)); if (action.completer != null) { action.completer!.completeError(error); } @@ -249,7 +251,8 @@ Middleware _sendNowRecurringInvoice( } }).catchError((Object error) { print(error); - store.dispatch(SendNowRecurringInvoicesFailure(error as List)); + store.dispatch( + SendNowRecurringInvoicesFailure(error as List)); if (action.completer != null) { action.completer.completeError(error); } diff --git a/lib/redux/static/static_selectors.dart b/lib/redux/static/static_selectors.dart index 568492d03..1420f1b3c 100644 --- a/lib/redux/static/static_selectors.dart +++ b/lib/redux/static/static_selectors.dart @@ -21,7 +21,8 @@ List countryList(BuiltMap countryMap) { } var memoizedCountryIso2Map = memo1( - (BuiltMap countryMap) => countryIso2Map(countryMap)); + (BuiltMap countryMap) => + countryIso2Map(countryMap)); Map countryIso2Map( BuiltMap countryMap) { @@ -92,7 +93,8 @@ var memoizedDateFormatList = memo1( (BuiltMap dateFormatMap) => dateFormatList(dateFormatMap)); -List dateFormatList(BuiltMap dateFormatMap) { +List dateFormatList( + BuiltMap dateFormatMap) { final list = dateFormatMap.keys.toList(); list.sort((idA, idB) => dateFormatMap[idA]! diff --git a/lib/redux/task_status/task_status_reducer.dart b/lib/redux/task_status/task_status_reducer.dart index 094e7de95..bf5d81c53 100644 --- a/lib/redux/task_status/task_status_reducer.dart +++ b/lib/redux/task_status/task_status_reducer.dart @@ -25,10 +25,14 @@ final forceSelectedReducer = combineReducers([ TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), ]); Reducer selectedIdReducer = combineReducers([ @@ -48,10 +52,14 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), TypedReducer( (selectedId, action) => action.clearSelection ? '' diff --git a/lib/redux/task_status/task_status_selectors.dart b/lib/redux/task_status/task_status_selectors.dart index bac352a09..054e59026 100644 --- a/lib/redux/task_status/task_status_selectors.dart +++ b/lib/redux/task_status/task_status_selectors.dart @@ -155,7 +155,8 @@ EntityStats taskStatsForTaskStatus( return EntityStats(countActive: countActive, countArchived: countArchived); } -String? defaultTaskStatusId(BuiltMap taskStatusMap) { +String? defaultTaskStatusId( + BuiltMap taskStatusMap) { final statusIds = taskStatusMap.keys.where((statusId) { final status = taskStatusMap[statusId]!; return status.isActive; diff --git a/lib/redux/transaction/transaction_reducer.dart b/lib/redux/transaction/transaction_reducer.dart index 5fd2b3330..a1ebd7bea 100644 --- a/lib/redux/transaction/transaction_reducer.dart +++ b/lib/redux/transaction/transaction_reducer.dart @@ -23,10 +23,14 @@ final forceSelectedReducer = combineReducers([ TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), - TypedReducer((completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), + TypedReducer( + (completer, action) => false), ]); final int? Function(int, dynamic) tabIndexReducer = combineReducers([ @@ -56,10 +60,14 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), - TypedReducer((selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), + TypedReducer( + (selectedId, action) => ''), TypedReducer( (selectedId, action) => action.clearSelection ? '' @@ -90,7 +98,8 @@ final editingReducer = combineReducers([ TypedReducer(_clearEditing), ]); -TransactionEntity _clearEditing(TransactionEntity? transaction, dynamic action) { +TransactionEntity _clearEditing( + TransactionEntity? transaction, dynamic action) { return TransactionEntity(); } diff --git a/lib/redux/transaction_rule/transaction_rule_selectors.dart b/lib/redux/transaction_rule/transaction_rule_selectors.dart index 0e47274a9..7744ec8c4 100644 --- a/lib/redux/transaction_rule/transaction_rule_selectors.dart +++ b/lib/redux/transaction_rule/transaction_rule_selectors.dart @@ -61,7 +61,8 @@ List filteredTransactionRulesSelector( return false; } else {} - if (!transactionRule!.matchesStates(transactionRuleListState.stateFilters)) { + if (!transactionRule! + .matchesStates(transactionRuleListState.stateFilters)) { return false; } diff --git a/lib/redux/user/user_reducer.dart b/lib/redux/user/user_reducer.dart index 016d77739..7c995cb20 100644 --- a/lib/redux/user/user_reducer.dart +++ b/lib/redux/user/user_reducer.dart @@ -36,7 +36,8 @@ Reducer selectedIdReducer = combineReducers([ TypedReducer((completer, action) => ''), TypedReducer((selectedId, action) => action.entityType == EntityType.user ? action.entityId : selectedId), - TypedReducer((String? selectedId, action) => action.userId), + TypedReducer( + (String? selectedId, action) => action.userId), TypedReducer( (String? selectedId, action) => action.user.id), TypedReducer( diff --git a/lib/redux/user/user_selectors.dart b/lib/redux/user/user_selectors.dart index 70497c698..6e3600fb3 100644 --- a/lib/redux/user/user_selectors.dart +++ b/lib/redux/user/user_selectors.dart @@ -99,8 +99,8 @@ List gmailUserList(BuiltMap userMap) { }).toList(); } -var memoizedMicrosoftUserList = - memo1((BuiltMap userMap) => microsoftUserList(userMap)); +var memoizedMicrosoftUserList = memo1( + (BuiltMap userMap) => microsoftUserList(userMap)); List microsoftUserList(BuiltMap userMap) { return userList(userMap).where((userId) { diff --git a/lib/redux/vendor/vendor_reducer.dart b/lib/redux/vendor/vendor_reducer.dart index 646eda021..a62c65ce1 100644 --- a/lib/redux/vendor/vendor_reducer.dart +++ b/lib/redux/vendor/vendor_reducer.dart @@ -24,7 +24,9 @@ EntityUIState vendorUIReducer(VendorUIState state, dynamic action) { ..forceSelected = forceSelectedReducer(state.forceSelected, action) ..tabIndex = tabIndexReducer(state.tabIndex, action) ..saveCompleter = saveCompleterReducer(state.saveCompleter, action) - ..cancelCompleter = cancelCompleterReducer(state.cancelCompleter as Completer?, action) as Completer?); + ..cancelCompleter = cancelCompleterReducer( + state.cancelCompleter as Completer?, action) + as Completer?); } final forceSelectedReducer = combineReducers([ diff --git a/lib/redux/vendor/vendor_selectors.dart b/lib/redux/vendor/vendor_selectors.dart index 83d729f33..ec8bc4c69 100644 --- a/lib/redux/vendor/vendor_selectors.dart +++ b/lib/redux/vendor/vendor_selectors.dart @@ -114,8 +114,11 @@ var memoizedCalculateVendorBalance = memo4((String vendorId, BuiltList expenseList) => calculateVendorBalance(vendorId, currencyId, expenseMap, expenseList)); -double calculateVendorBalance(String vendorId, String currencyId, - BuiltMap expenseMap, BuiltList expenseList) { +double calculateVendorBalance( + String vendorId, + String currencyId, + BuiltMap expenseMap, + BuiltList expenseList) { double total = 0; expenseList.forEach((expenseId) { diff --git a/lib/ui/app/buttons/bottom_buttons.dart b/lib/ui/app/buttons/bottom_buttons.dart index ba68930f6..cf35153bf 100644 --- a/lib/ui/app/buttons/bottom_buttons.dart +++ b/lib/ui/app/buttons/bottom_buttons.dart @@ -88,7 +88,9 @@ class BottomButtons extends StatelessWidget { textAlign: TextAlign.center, style: TextStyle( color: textColor.withOpacity( - action2Enabled && !entity!.isDeleted! ? 1 : .6)), + action2Enabled && !entity!.isDeleted! + ? 1 + : .6)), ), ], ), diff --git a/lib/ui/app/confirm_email.dart b/lib/ui/app/confirm_email.dart index 25ede6923..9967edaa8 100644 --- a/lib/ui/app/confirm_email.dart +++ b/lib/ui/app/confirm_email.dart @@ -51,7 +51,8 @@ class ConfirmEmail extends StatelessWidget { Padding( padding: const EdgeInsets.only(bottom: kTableColumnGap), child: TextButton( - onPressed: viewModel.onResendPressed as void Function()?, + onPressed: + viewModel.onResendPressed as void Function()?, child: Text(localization.resendEmail.toUpperCase()), ), ), @@ -91,14 +92,16 @@ class ConfirmEmail extends StatelessWidget { Padding( padding: const EdgeInsets.only(bottom: kTableColumnGap), child: TextButton( - onPressed: viewModel.onRefreshPressed as void Function()?, + onPressed: + viewModel.onRefreshPressed as void Function()?, child: Text(localization.refreshData.toUpperCase()), ), ), Padding( padding: const EdgeInsets.only(bottom: kTableColumnGap), child: TextButton( - onPressed: viewModel.onLogoutPressed as void Function()?, + onPressed: + viewModel.onLogoutPressed as void Function()?, child: Text(localization.logout.toUpperCase()), ), ), diff --git a/lib/ui/app/edit_scaffold.dart b/lib/ui/app/edit_scaffold.dart index f4e31092d..dbb90b104 100644 --- a/lib/ui/app/edit_scaffold.dart +++ b/lib/ui/app/edit_scaffold.dart @@ -190,7 +190,8 @@ class EditScaffold extends StatelessWidget { entity != null && entity!.isOld) ...[ EntityStatusChip( - entity: state.getEntity(entity!.entityType, entity!.id)), + entity: + state.getEntity(entity!.entityType, entity!.id)), SizedBox(width: 8), ], if (showOverflow) @@ -437,32 +438,37 @@ class EditScaffold extends StatelessWidget { itemBuilder: (BuildContext context) => >[ ...actions! - .map((action) => action == null - ? PopupMenuDivider() - : PopupMenuItem( - child: Row( - children: [ - Icon( - getEntityActionIcon(action), - color: Theme.of(context) - .colorScheme - .secondary, + .map((action) => action == null + ? PopupMenuDivider() + : PopupMenuItem( + child: Row( + children: [ + Icon( + getEntityActionIcon(action), + color: Theme.of(context) + .colorScheme + .secondary, + ), + SizedBox(width: 16.0), + Text(AppLocalization.of( + context)! + .lookup( + action.toString())!), + ], ), - SizedBox(width: 16.0), - Text(AppLocalization.of(context)! - .lookup(action.toString())!), - ], - ), - value: action, - )) - .toList() as Iterable> + value: action, + )) + .toList() + as Iterable> ], onSelected: (action) => onActionPressed!(context, action), enabled: isEnabled, ) ], - bottom: isFullscreen && isDesktop(context) ? null : appBarBottom as PreferredSizeWidget?, + bottom: isFullscreen && isDesktop(context) + ? null + : appBarBottom as PreferredSizeWidget?, ), bottomNavigationBar: bottomNavigationBar, floatingActionButtonLocation: diff --git a/lib/ui/app/forms/notification_settings.dart b/lib/ui/app/forms/notification_settings.dart index b561d1f77..7409d0a17 100644 --- a/lib/ui/app/forms/notification_settings.dart +++ b/lib/ui/app/forms/notification_settings.dart @@ -32,8 +32,8 @@ class NotificationSettings extends StatelessWidget { Widget build(BuildContext context) { final state = StoreProvider.of(context).state; final localization = AppLocalization.of(context)!; - final notifications = - user.userCompany!.notifications ?? BuiltMap>(); + final notifications = user.userCompany!.notifications ?? + BuiltMap>(); final BuiltList emailNotifications = notifications.containsKey(kNotificationChannelEmail) ? notifications[kNotificationChannelEmail]! diff --git a/lib/ui/app/list_scaffold.dart b/lib/ui/app/list_scaffold.dart index e008fb07f..428c62609 100644 --- a/lib/ui/app/list_scaffold.dart +++ b/lib/ui/app/list_scaffold.dart @@ -113,7 +113,8 @@ class ListScaffold extends StatelessWidget { if (isDesktop(context) && onCheckboxPressed != null) IconButton( icon: Icon(Icons.check_box), - tooltip: prefState.enableTooltips ? localization!.multiselect : null, + tooltip: + prefState.enableTooltips ? localization!.multiselect : null, onPressed: state.prefState.showKanban && state.uiState.mainRoute == '${EntityType.task}' ? null diff --git a/lib/ui/app/lists/list_filter.dart b/lib/ui/app/lists/list_filter.dart index 69bf5f722..b80de26b8 100644 --- a/lib/ui/app/lists/list_filter.dart +++ b/lib/ui/app/lists/list_filter.dart @@ -29,7 +29,8 @@ class ListFilterMessage extends StatelessWidget { @override Widget build(BuildContext context) { final state = StoreProvider.of(context).state; - final filteredEntity = state.getEntityMap(filterEntityType)![filterEntityId]; + final filteredEntity = + state.getEntityMap(filterEntityType)![filterEntityId]; return Material( color: Colors.orange, diff --git a/lib/ui/app/resources/cached_image.dart b/lib/ui/app/resources/cached_image.dart index ad4d90529..d25f98fbd 100644 --- a/lib/ui/app/resources/cached_image.dart +++ b/lib/ui/app/resources/cached_image.dart @@ -43,7 +43,8 @@ class CachedImage extends StatelessWidget { url!, width: width, height: height, - key: ValueKey(url! + (apiToken != null ? apiToken!.substring(0, 8) : '')), + key: ValueKey( + url! + (apiToken != null ? apiToken!.substring(0, 8) : '')), fit: BoxFit.contain, headers: apiToken != null ? {'X-API-TOKEN': apiToken!} : null, ); diff --git a/lib/ui/client/client_list_item.dart b/lib/ui/client/client_list_item.dart index dfa24d802..ced7c99ab 100644 --- a/lib/ui/client/client_list_item.dart +++ b/lib/ui/client/client_list_item.dart @@ -124,7 +124,9 @@ class ClientListItem extends StatelessWidget { children: [ Text( client!.displayName + - (client!.documents.isNotEmpty ? ' 📎' : ''), + (client!.documents.isNotEmpty + ? ' 📎' + : ''), style: textStyle), if (filterMatch != null) Text( diff --git a/lib/ui/client/client_pdf.dart b/lib/ui/client/client_pdf.dart index ea5390d17..633136069 100644 --- a/lib/ui/client/client_pdf.dart +++ b/lib/ui/client/client_pdf.dart @@ -355,7 +355,8 @@ class _ClientPdfViewState extends State { fileName, _response!.bodyBytes); } else { final directory = await (isDesktopOS() - ? getDownloadsDirectory() as FutureOr + ? getDownloadsDirectory() + as FutureOr : getApplicationDocumentsDirectory()); String filePath = '${directory.path}${file.Platform.pathSeparator}$fileName'; diff --git a/lib/ui/client/client_presenter.dart b/lib/ui/client/client_presenter.dart index 777630674..b5f71ca7b 100644 --- a/lib/ui/client/client_presenter.dart +++ b/lib/ui/client/client_presenter.dart @@ -120,7 +120,8 @@ class ClientPresenter extends EntityPresenter { formatNumber(client!.paidToDate, context, clientId: client.id)!), ); case ClientFields.country: - return Text(state.staticState.countryMap[client!.countryId]?.name ?? ''); + return Text( + state.staticState.countryMap[client!.countryId]?.name ?? ''); case ClientFields.language: return Text( state.staticState.languageMap[client!.languageId]?.name ?? ''); diff --git a/lib/ui/client/edit/client_edit_contacts.dart b/lib/ui/client/edit/client_edit_contacts.dart index bc97d0e37..aff3607f4 100644 --- a/lib/ui/client/edit/client_edit_contacts.dart +++ b/lib/ui/client/edit/client_edit_contacts.dart @@ -46,8 +46,8 @@ class _ClientEditContactsState extends State { key: Key(contact!.entityKey), contact: contact, isDialog: client.contacts.length > 1, - index: client.contacts - .indexOf(client.contacts.firstWhere((c) => c!.id == contact.id)), + index: client.contacts.indexOf( + client.contacts.firstWhere((c) => c!.id == contact.id)), ); }); } @@ -148,8 +148,9 @@ class ContactListTile extends StatelessWidget { style: TextStyle( fontStyle: FontStyle.italic, )), - subtitle: Text( - contact!.email.isNotEmpty ? contact!.email : contact!.phone), + subtitle: Text(contact!.email.isNotEmpty + ? contact!.email + : contact!.phone), trailing: Icon(Icons.navigate_next), ), Divider( @@ -365,8 +366,8 @@ class ContactEditDetailsState extends State { title: Text(localization.addToInvoices!), value: _contact!.sendEmail, onChanged: (value) { - setState(() => - _contact = _contact!.rebuild((b) => b..sendEmail = value)); + setState(() => _contact = + _contact!.rebuild((b) => b..sendEmail = value)); viewModel.onChangedContact( _contact!.rebuild((b) => b..sendEmail = value), diff --git a/lib/ui/client/view/client_view_ledger.dart b/lib/ui/client/view/client_view_ledger.dart index 383f48c11..ef064ca14 100644 --- a/lib/ui/client/view/client_view_ledger.dart +++ b/lib/ui/client/view/client_view_ledger.dart @@ -95,7 +95,8 @@ class _ClientViewLedgerState extends State { return ListTile( onTap: () => viewEntity(entity: entity as BaseEntity), - onLongPress: () => showEntityActionsDialog(entities: [entity as BaseEntity?]), + onLongPress: () => + showEntityActionsDialog(entities: [entity as BaseEntity?]), title: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/ui/company_gateway/view/company_gateway_view.dart b/lib/ui/company_gateway/view/company_gateway_view.dart index b74ca2dfa..9c5d7fe4d 100644 --- a/lib/ui/company_gateway/view/company_gateway_view.dart +++ b/lib/ui/company_gateway/view/company_gateway_view.dart @@ -113,7 +113,8 @@ class _CompanyGatewayOverview extends StatelessWidget { final webhookUrl = '${state.account!.defaultUrl}/payment_webhook/${state.company!.companyKey}/${companyGateway.id}'; - final Map> allFields = >{}; + final Map> allFields = + >{}; for (var gatewayTypeId in kGatewayTypes.keys) { final Map fields = {}; if (companyGateway.feesAndLimitsMap.containsKey(gatewayTypeId)) { diff --git a/lib/ui/credit/credit_presenter.dart b/lib/ui/credit/credit_presenter.dart index 1bc129979..2bf965e47 100644 --- a/lib/ui/credit/credit_presenter.dart +++ b/lib/ui/credit/credit_presenter.dart @@ -117,8 +117,8 @@ class CreditPresenter extends EntityPresenter { case CreditFields.documents: return Text('${credit.documents.length}'); case CreditFields.taxAmount: - return Text( - formatNumber(credit.taxAmount, context, clientId: credit.clientId)!); + return Text(formatNumber(credit.taxAmount, context, + clientId: credit.clientId)!); case CreditFields.exchangeRate: return Text(formatNumber(credit.exchangeRate, context, formatNumberType: FormatNumberType.double)!); @@ -137,7 +137,8 @@ class CreditPresenter extends EntityPresenter { case CreditFields.clientPostalCode: return Text(client!.postalCode); case CreditFields.clientCountry: - return Text(state.staticState.countryMap[client!.countryId]?.name ?? ''); + return Text( + state.staticState.countryMap[client!.countryId]?.name ?? ''); case CreditFields.contactName: case CreditFields.contactEmail: final contact = creditContactSelector( diff --git a/lib/ui/design/view/design_view.dart b/lib/ui/design/view/design_view.dart index 38874edb9..571550aa8 100644 --- a/lib/ui/design/view/design_view.dart +++ b/lib/ui/design/view/design_view.dart @@ -47,7 +47,8 @@ class _DesignViewState extends State { count += state.invoiceState.list .map((invoiceId) => state.invoiceState.map[invoiceId]) - .where((invoice) => !invoice!.isDeleted! && invoice.designId == design.id) + .where( + (invoice) => !invoice!.isDeleted! && invoice.designId == design.id) .length; count += state.quoteState.list @@ -62,7 +63,8 @@ class _DesignViewState extends State { count += state.recurringInvoiceState.list .map((invoiceId) => state.recurringInvoiceState.map[invoiceId]) - .where((invoice) => !invoice!.isDeleted! && invoice.designId == design.id) + .where( + (invoice) => !invoice!.isDeleted! && invoice.designId == design.id) .length; return ViewScaffold( diff --git a/lib/ui/document/edit/document_edit.dart b/lib/ui/document/edit/document_edit.dart index 7fe1e1dcc..daa2fa00c 100644 --- a/lib/ui/document/edit/document_edit.dart +++ b/lib/ui/document/edit/document_edit.dart @@ -85,8 +85,9 @@ class _DocumentEditState extends State { return EditScaffold( entity: document, - title: - document.isNew ? localization!.newDocument : localization!.editDocument, + title: document.isNew + ? localization!.newDocument + : localization!.editDocument, onSavePressed: (_) => _onSavePressed(), onCancelPressed: (context) => viewModel.onCancelPressed(context), body: Form( diff --git a/lib/ui/expense/edit/expense_edit_notes.dart b/lib/ui/expense/edit/expense_edit_notes.dart index c30aa2aa2..a30ea7d7e 100644 --- a/lib/ui/expense/edit/expense_edit_notes.dart +++ b/lib/ui/expense/edit/expense_edit_notes.dart @@ -125,8 +125,8 @@ class ExpenseEditNotesState extends State { SizedBox(height: 8), DocumentGrid( documents: expense.documents.toList(), - onUploadDocument: (path, isPrivate) => widget.viewModel - .onUploadDocument!(context, path, isPrivate), + onUploadDocument: (path, isPrivate) => widget + .viewModel.onUploadDocument!(context, path, isPrivate), onRenamedDocument: () => store.dispatch(LoadExpense(expenseId: expense.id)), ) diff --git a/lib/ui/expense/expense_presenter.dart b/lib/ui/expense/expense_presenter.dart index af66673c2..ccdd7d59d 100644 --- a/lib/ui/expense/expense_presenter.dart +++ b/lib/ui/expense/expense_presenter.dart @@ -97,8 +97,8 @@ class ExpensePresenter extends EntityPresenter { case ExpenseFields.transactionReference: return Text(expense!.transactionReference); case ExpenseFields.currency: - return Text(state - .staticState.currencyMap[expense!.currencyId]?.listDisplayName ?? + return Text(state.staticState.currencyMap[expense!.currencyId] + ?.listDisplayName ?? ''); case ExpenseFields.category: final category = state.expenseCategoryState.map[expense!.categoryId]; diff --git a/lib/ui/expense/view/expense_view_documents.dart b/lib/ui/expense/view/expense_view_documents.dart index 1331331cc..360e0b60c 100644 --- a/lib/ui/expense/view/expense_view_documents.dart +++ b/lib/ui/expense/view/expense_view_documents.dart @@ -10,8 +10,7 @@ import 'package:invoiceninja_flutter/ui/app/document_grid.dart'; import 'package:invoiceninja_flutter/ui/expense/view/expense_view_vm.dart'; class ExpenseViewDocuments extends StatelessWidget { - const ExpenseViewDocuments( - {required this.expense, required this.viewModel}); + const ExpenseViewDocuments({required this.expense, required this.viewModel}); final AbstractExpenseViewVM viewModel; final ExpenseEntity? expense; diff --git a/lib/ui/expense_category/edit/expense_category_edit_vm.dart b/lib/ui/expense_category/edit/expense_category_edit_vm.dart index 8647731a2..d933eb674 100644 --- a/lib/ui/expense_category/edit/expense_category_edit_vm.dart +++ b/lib/ui/expense_category/edit/expense_category_edit_vm.dart @@ -94,7 +94,8 @@ class ExpenseCategoryEditVM { UpdateCurrentRoute(ExpenseCategoryViewScreen.route)); if (expenseCategory.isNew && state.expenseCategoryUIState.saveCompleter == null) { - navigator!.pushReplacementNamed(ExpenseCategoryViewScreen.route); + navigator! + .pushReplacementNamed(ExpenseCategoryViewScreen.route); } else { navigator!.pop(savedExpenseCategory); } diff --git a/lib/ui/invoice/invoice_list_item.dart b/lib/ui/invoice/invoice_list_item.dart index dca3fedc4..d978c86e7 100644 --- a/lib/ui/invoice/invoice_list_item.dart +++ b/lib/ui/invoice/invoice_list_item.dart @@ -190,7 +190,8 @@ class InvoiceListItem extends StatelessWidget { : ListTile( onTap: () => onTap != null ? onTap!() - : selectEntity(entity: invoice!, forceView: !showCheckbox), + : selectEntity( + entity: invoice!, forceView: !showCheckbox), onLongPress: () => onTap != null ? null : selectEntity(entity: invoice!, longPress: true), diff --git a/lib/ui/invoice/invoice_pdf.dart b/lib/ui/invoice/invoice_pdf.dart index 38312962d..c87e5d6f4 100644 --- a/lib/ui/invoice/invoice_pdf.dart +++ b/lib/ui/invoice/invoice_pdf.dart @@ -97,8 +97,8 @@ class _InvoicePdfViewState extends State { _isLoading = false; if (kIsWeb && state!.prefState.enableNativeBrowser) { - _pdfString = - 'data:application/pdf;base64,' + base64Encode(response!.bodyBytes); + _pdfString = 'data:application/pdf;base64,' + + base64Encode(response!.bodyBytes); WebUtils.registerWebView(_pdfString); } }); @@ -270,7 +270,8 @@ class _InvoicePdfViewState extends State { fileName, _response!.bodyBytes); } else { final directory = await (isDesktopOS() - ? getDownloadsDirectory() as FutureOr + ? getDownloadsDirectory() + as FutureOr : getApplicationDocumentsDirectory()); String filePath = '${directory.path}${file.Platform.pathSeparator}$fileName'; @@ -340,12 +341,13 @@ Future _loadPDF( final url = isDeliveryNote ? '/invoices/${invoice.id}/delivery_note' : '/activities/download_entity/$activityId'; - response = await (WebClient() - .get('${credential.url}$url', credential.token, rawResponse: true) as FutureOr); + response = await (WebClient().get('${credential.url}$url', credential.token, + rawResponse: true) as FutureOr); } else { final invitation = invoice.invitations.first; final url = invitation.downloadLink; - response = await (WebClient().get(url, '', rawResponse: true) as FutureOr); + response = await (WebClient().get(url, '', rawResponse: true) + as FutureOr); } if (response!.statusCode >= 400) { diff --git a/lib/ui/invoice/invoice_presenter.dart b/lib/ui/invoice/invoice_presenter.dart index d0b7d3686..6efde254e 100644 --- a/lib/ui/invoice/invoice_presenter.dart +++ b/lib/ui/invoice/invoice_presenter.dart @@ -164,7 +164,8 @@ class InvoicePresenter extends EntityPresenter { case InvoiceFields.clientPostalCode: return Text(client!.postalCode); case InvoiceFields.clientCountry: - return Text(state.staticState.countryMap[client!.countryId]?.name ?? ''); + return Text( + state.staticState.countryMap[client!.countryId]?.name ?? ''); case InvoiceFields.contactName: case InvoiceFields.contactEmail: final contact = invoiceContactSelector( diff --git a/lib/ui/payment/payment_presenter.dart b/lib/ui/payment/payment_presenter.dart index f53bd7a5d..e017a1b67 100644 --- a/lib/ui/payment/payment_presenter.dart +++ b/lib/ui/payment/payment_presenter.dart @@ -93,7 +93,8 @@ class PaymentPresenter extends EntityPresenter { case PaymentFields.amount: return Align( alignment: Alignment.centerRight, - child: Text(formatNumber(payment!.amount - payment.refunded, context, + child: Text(formatNumber( + payment!.amount - payment.refunded, context, clientId: payment.clientId)!)); case PaymentFields.convertedAmount: return Align( @@ -124,7 +125,8 @@ class PaymentPresenter extends EntityPresenter { state.companyGatewayState.get(payment!.companyGatewayId)!; return Text(companyGateway.label); case PaymentFields.gatewayType: - return Text(localization!.lookup(kGatewayTypes[payment!.gatewayTypeId])!); + return Text( + localization!.lookup(kGatewayTypes[payment!.gatewayTypeId])!); } return super.getField(field: field, context: context); diff --git a/lib/ui/product/product_list_item.dart b/lib/ui/product/product_list_item.dart index b1828f52a..396330457 100644 --- a/lib/ui/product/product_list_item.dart +++ b/lib/ui/product/product_list_item.dart @@ -181,7 +181,8 @@ class ProductListItem extends StatelessWidget { ), Text( formatNumber( - showCost ? product!.cost : product!.price, context, + showCost ? product!.cost : product!.price, + context, roundToPrecision: false)!, style: Theme.of(context).textTheme.titleMedium), ], diff --git a/lib/ui/product/product_presenter.dart b/lib/ui/product/product_presenter.dart index fba719883..c01cb6349 100644 --- a/lib/ui/product/product_presenter.dart +++ b/lib/ui/product/product_presenter.dart @@ -106,7 +106,8 @@ class ProductPresenter extends EntityPresenter { return Text(formatNumber(product!.stockQuantity.toDouble(), context, formatNumberType: FormatNumberType.int)!); case ProductFields.taxCategory: - return Text(localization!.lookup(kTaxCategories[product!.taxCategoryId])!); + return Text( + localization!.lookup(kTaxCategories[product!.taxCategoryId])!); case ProductFields.notificationThreshold: final store = StoreProvider.of(context); return Text(formatNumber( diff --git a/lib/ui/project/edit/project_edit.dart b/lib/ui/project/edit/project_edit.dart index 2dee357df..e21af9e78 100644 --- a/lib/ui/project/edit/project_edit.dart +++ b/lib/ui/project/edit/project_edit.dart @@ -135,7 +135,8 @@ class _ProjectEditState extends State { return EditScaffold( entity: project, - title: project.isNew ? localization!.newProject : localization!.editProject, + title: + project.isNew ? localization!.newProject : localization!.editProject, onCancelPressed: (context) => viewModel.onCancelPressed(context), onSavePressed: _onSavePressed, body: Form( diff --git a/lib/ui/purchase_order/purchase_order_presenter.dart b/lib/ui/purchase_order/purchase_order_presenter.dart index 3b58a2a22..3e72a469a 100644 --- a/lib/ui/purchase_order/purchase_order_presenter.dart +++ b/lib/ui/purchase_order/purchase_order_presenter.dart @@ -135,7 +135,8 @@ class PurchaseOrderPresenter extends EntityPresenter { case PurchaseOrderFields.vendorPostalCode: return Text(vendor!.postalCode); case PurchaseOrderFields.vendorCountry: - return Text(state.staticState.countryMap[client!.countryId]?.name ?? ''); + return Text( + state.staticState.countryMap[client!.countryId]?.name ?? ''); case PurchaseOrderFields.contactName: case PurchaseOrderFields.contactEmail: final contact = purchaseOrderContactSelector( diff --git a/lib/ui/quote/quote_presenter.dart b/lib/ui/quote/quote_presenter.dart index 1bf8e08a8..7f97c1ce9 100644 --- a/lib/ui/quote/quote_presenter.dart +++ b/lib/ui/quote/quote_presenter.dart @@ -70,8 +70,9 @@ class QuotePresenter extends EntityPresenter { case QuoteFields.status: return EntityStatusChip(entity: quote, showState: true); case QuoteFields.number: - return Text( - (quote.number ?? '').isEmpty ? localization!.pending : quote.number); + return Text((quote.number ?? '').isEmpty + ? localization!.pending + : quote.number); case QuoteFields.client: return LinkTextRelatedEntity(entity: client, relation: quote); case QuoteFields.date: @@ -130,7 +131,8 @@ class QuotePresenter extends EntityPresenter { case QuoteFields.clientPostalCode: return Text(client!.postalCode); case QuoteFields.clientCountry: - return Text(state.staticState.countryMap[client!.countryId]?.name ?? ''); + return Text( + state.staticState.countryMap[client!.countryId]?.name ?? ''); case QuoteFields.contactName: case QuoteFields.contactEmail: final contact = diff --git a/lib/ui/recurring_expense/recurring_expense_presenter.dart b/lib/ui/recurring_expense/recurring_expense_presenter.dart index d3b92620a..7d3795755 100644 --- a/lib/ui/recurring_expense/recurring_expense_presenter.dart +++ b/lib/ui/recurring_expense/recurring_expense_presenter.dart @@ -104,8 +104,8 @@ class RecurringExpensePresenter extends EntityPresenter { case RecurringExpenseFields.shouldBeInvoiced: return Text(expense!.shouldBeInvoiced.toString()); case RecurringExpenseFields.currencyId: - return Text(state - .staticState.currencyMap[expense!.currencyId]?.listDisplayName ?? + return Text(state.staticState.currencyMap[expense!.currencyId] + ?.listDisplayName ?? ''); case RecurringExpenseFields.category: return Text(state.expenseCategoryState.map[expense!.categoryId] diff --git a/lib/ui/recurring_invoice/recurring_invoice_list_item.dart b/lib/ui/recurring_invoice/recurring_invoice_list_item.dart index 7e6542789..ae9d352fa 100644 --- a/lib/ui/recurring_invoice/recurring_invoice_list_item.dart +++ b/lib/ui/recurring_invoice/recurring_invoice_list_item.dart @@ -222,8 +222,8 @@ class RecurringInvoiceListItem extends StatelessWidget { (invoice!.nextSendDate.isNotEmpty ? ' • ' : '') + - formatDate( - invoice!.nextSendDate, context) + + formatDate(invoice!.nextSendDate, + context) + (invoice!.documents.isNotEmpty ? ' 📎' : '')) diff --git a/lib/ui/settings/generated_numbers.dart b/lib/ui/settings/generated_numbers.dart index 290f5d261..f9bf88593 100644 --- a/lib/ui/settings/generated_numbers.dart +++ b/lib/ui/settings/generated_numbers.dart @@ -301,7 +301,8 @@ class _GeneratedNumbersState extends State MapEntry>( id, DropdownMenuItem( - child: Text(localization.lookup(frequency)!), + child: + Text(localization.lookup(frequency)!), value: id, ))) .values diff --git a/lib/ui/settings/task_settings.dart b/lib/ui/settings/task_settings.dart index cbaa8ea16..a699f35f9 100644 --- a/lib/ui/settings/task_settings.dart +++ b/lib/ui/settings/task_settings.dart @@ -183,7 +183,8 @@ class _TaskSettingsState extends State { activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.invoiceTaskItemDescription!), value: company.invoiceTaskItemDescription, - subtitle: Text(localization.invoiceTaskItemDescriptionHelp!), + subtitle: + Text(localization.invoiceTaskItemDescriptionHelp!), onChanged: (value) => viewModel.onCompanyChanged(company .rebuild((b) => b..invoiceTaskItemDescription = value)), ), diff --git a/lib/ui/settings/user_details.dart b/lib/ui/settings/user_details.dart index 2ef842a21..77cd1029c 100644 --- a/lib/ui/settings/user_details.dart +++ b/lib/ui/settings/user_details.dart @@ -277,23 +277,23 @@ class _UserDetailsState extends State .toUpperCase(), textAlign: TextAlign.center, ), - onPressed: - state.user!.isConnectedToGoogle || state.user!.isConnectedToMicrosoft - ? null - : () { - if (state.settingsUIState.isChanged) { - showMessageDialog( - context: context, - message: localization.errorUnsavedChanges); - return; - } + onPressed: state.user!.isConnectedToGoogle || + state.user!.isConnectedToMicrosoft + ? null + : () { + if (state.settingsUIState.isChanged) { + showMessageDialog( + context: context, + message: localization.errorUnsavedChanges); + return; + } - if (state.user!.isConnectedToApple) { - viewModel.onDisconnectApplePressed(context); - } else { - // do nothing - } - }, + if (state.user!.isConnectedToApple) { + viewModel.onDisconnectApplePressed(context); + } else { + // do nothing + } + }, ), ); @@ -415,7 +415,8 @@ class _UserDetailsState extends State } if (state.isHosted && !state.user!.phoneVerified) { - final bool? phoneVerified = await showDialog( + final bool? phoneVerified = + await showDialog( context: context, builder: (BuildContext context) => UserSmsVerification(), diff --git a/lib/ui/task/edit/task_edit.dart b/lib/ui/task/edit/task_edit.dart index 3f23a7abf..15d5720ce 100644 --- a/lib/ui/task/edit/task_edit.dart +++ b/lib/ui/task/edit/task_edit.dart @@ -229,7 +229,8 @@ class _BottomBar extends StatelessWidget { )!, ), context, - clientId: state.clientState.get(task.clientId)!.id, + clientId: + state.clientState.get(task.clientId)!.id, )!; } diff --git a/lib/ui/task/kanban/kanban_card.dart b/lib/ui/task/kanban/kanban_card.dart index 39d3e2cf2..49cc92c16 100644 --- a/lib/ui/task/kanban/kanban_card.dart +++ b/lib/ui/task/kanban/kanban_card.dart @@ -297,7 +297,8 @@ class _KanbanTaskCardState extends State { startLabel, ] .map((value) => PopupMenuItem( - child: Text(localization.lookup(value)!), + child: + Text(localization.lookup(value)!), value: value, )) .toList(); diff --git a/lib/ui/task/kanban/kanban_view.dart b/lib/ui/task/kanban/kanban_view.dart index 87c45a1a9..40e517a33 100644 --- a/lib/ui/task/kanban/kanban_view.dart +++ b/lib/ui/task/kanban/kanban_view.dart @@ -238,7 +238,8 @@ class KanbanViewState extends State { _tasks![status.id]!.indexOf(task.id)) && task.statusId == statusId, onSavePressed: (completer, description) { - final statusOrder = _tasks![status.id]!.indexOf(task.id); + final statusOrder = + _tasks![status.id]!.indexOf(task.id); widget.viewModel.onSaveTaskPressed( completer, task.id, diff --git a/lib/ui/task/task_list_item.dart b/lib/ui/task/task_list_item.dart index af94f89f0..0fe62a87e 100644 --- a/lib/ui/task/task_list_item.dart +++ b/lib/ui/task/task_list_item.dart @@ -48,7 +48,8 @@ class TaskListItem extends StatelessWidget { final taskUIState = uiState.taskUIState; final client = state.clientState.get(task!.clientId)!; final filterMatch = filter != null && filter!.isNotEmpty - ? (task!.matchesFilterValue(filter) ?? client.matchesFilterValue(filter)) + ? (task!.matchesFilterValue(filter) ?? + client.matchesFilterValue(filter)) : null; final listUIState = taskUIState.listUIState; final isInMultiselect = listUIState.isInMultiselect(); diff --git a/lib/ui/transaction/transaction_list_item.dart b/lib/ui/transaction/transaction_list_item.dart index 670ae7106..2187460ba 100644 --- a/lib/ui/transaction/transaction_list_item.dart +++ b/lib/ui/transaction/transaction_list_item.dart @@ -65,8 +65,9 @@ class TransactionListItem extends StatelessWidget { builder: (BuildContext context, BoxConstraints constraints) { return constraints.maxWidth > kTableListWidthCutoff ? InkWell( - onTap: () => - onTap != null ? onTap!() : selectEntity(entity: transaction!), + onTap: () => onTap != null + ? onTap!() + : selectEntity(entity: transaction!), onLongPress: () => onLongPress != null ? onLongPress!() : selectEntity(entity: transaction!, longPress: true), @@ -115,7 +116,8 @@ class TransactionListItem extends StatelessWidget { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(transaction!.description, style: textStyle), + Text(transaction!.description, + style: textStyle), Text( state.bankAccountState .get(transaction!.bankAccountId)! @@ -168,8 +170,9 @@ class TransactionListItem extends StatelessWidget { ), ) : ListTile( - onTap: () => - onTap != null ? onTap!() : selectEntity(entity: transaction!), + onTap: () => onTap != null + ? onTap!() + : selectEntity(entity: transaction!), onLongPress: () => onLongPress != null ? onLongPress!() : selectEntity(entity: transaction!, longPress: true), diff --git a/lib/ui/transaction/transaction_presenter.dart b/lib/ui/transaction/transaction_presenter.dart index a45d5580b..c0686cfb8 100644 --- a/lib/ui/transaction/transaction_presenter.dart +++ b/lib/ui/transaction/transaction_presenter.dart @@ -126,7 +126,8 @@ class TransactionPresenter extends EntityPresenter { final vendor = state.vendorState.get(transaction!.vendorId); return LinkTextRelatedEntity(entity: vendor, relation: transaction); case TransactionFields.category: - final category = state.expenseCategoryState.get(transaction!.categoryId); + final category = + state.expenseCategoryState.get(transaction!.categoryId); return LinkTextRelatedEntity(entity: category, relation: transaction); } diff --git a/lib/ui/transaction/transaction_screen.dart b/lib/ui/transaction/transaction_screen.dart index 93e1fc606..e0a3820b9 100644 --- a/lib/ui/transaction/transaction_screen.dart +++ b/lib/ui/transaction/transaction_screen.dart @@ -77,7 +77,8 @@ class TransactionScreen extends StatelessWidget { store.dispatch(FilterTransactionsByState(state)); }, onSelectedStatus: (EntityStatus status, value) { - store.dispatch(FilterTransactionsByStatus(status as TransactionStatusEntity)); + store.dispatch( + FilterTransactionsByStatus(status as TransactionStatusEntity)); }, statuses: statuses, ), diff --git a/lib/ui/transaction_rule/edit/transaction_rule_edit.dart b/lib/ui/transaction_rule/edit/transaction_rule_edit.dart index 63f0e3753..6cd55f40a 100644 --- a/lib/ui/transaction_rule/edit/transaction_rule_edit.dart +++ b/lib/ui/transaction_rule/edit/transaction_rule_edit.dart @@ -183,7 +183,8 @@ class _TransactionRuleEditState extends State { Text(localization.lookup(rule!.searchKey)!), ), Expanded( - child: Text(localization.lookup(rule.operator)!), + child: + Text(localization.lookup(rule.operator)!), ), Expanded( child: Text(rule.value), diff --git a/lib/ui/transaction_rule/view/transaction_rule_view.dart b/lib/ui/transaction_rule/view/transaction_rule_view.dart index 2e452a55e..732d0811b 100644 --- a/lib/ui/transaction_rule/view/transaction_rule_view.dart +++ b/lib/ui/transaction_rule/view/transaction_rule_view.dart @@ -65,8 +65,9 @@ class _TransactionRuleViewState extends State { : localization.disabled, localization.vendor: state.vendorState.get(transactionRule.vendorId)!.name, - localization.category: - state.expenseCategoryState.get(transactionRule.categoryId)!.name, + localization.category: state.expenseCategoryState + .get(transactionRule.categoryId)! + .name, }), if (transactionRule.rules.isNotEmpty) ...[ Padding( diff --git a/lib/ui/vendor/edit/vendor_edit_contacts.dart b/lib/ui/vendor/edit/vendor_edit_contacts.dart index e305fe6de..80f8449b6 100644 --- a/lib/ui/vendor/edit/vendor_edit_contacts.dart +++ b/lib/ui/vendor/edit/vendor_edit_contacts.dart @@ -45,8 +45,8 @@ class _VendorEditContactsState extends State { key: Key(contact!.entityKey), contact: contact, isDialog: vendor.contacts.length > 1, - index: vendor.contacts - .indexOf(vendor.contacts.firstWhere((c) => c!.id == contact.id)), + index: vendor.contacts.indexOf( + vendor.contacts.firstWhere((c) => c!.id == contact.id)), ); }); } @@ -147,8 +147,9 @@ class ContactListTile extends StatelessWidget { style: TextStyle( fontStyle: FontStyle.italic, )), - subtitle: Text( - contact!.email.isNotEmpty ? contact!.email : contact!.phone), + subtitle: Text(contact!.email.isNotEmpty + ? contact!.email + : contact!.phone), trailing: Icon(Icons.navigate_next), ), Divider( diff --git a/lib/ui/vendor/vendor_list_item.dart b/lib/ui/vendor/vendor_list_item.dart index 0599a462f..d9b2ca5c1 100644 --- a/lib/ui/vendor/vendor_list_item.dart +++ b/lib/ui/vendor/vendor_list_item.dart @@ -198,7 +198,8 @@ class VendorListItem extends StatelessWidget { .textTheme .titleSmall! .copyWith( - color: textColor!.withOpacity(kLighterOpacity), + color: + textColor!.withOpacity(kLighterOpacity), )) : Text(vendor.number), EntityStateLabel(vendor), diff --git a/lib/ui/vendor/vendor_presenter.dart b/lib/ui/vendor/vendor_presenter.dart index e08db8be6..7669cbcc5 100644 --- a/lib/ui/vendor/vendor_presenter.dart +++ b/lib/ui/vendor/vendor_presenter.dart @@ -83,7 +83,8 @@ class VendorPresenter extends EntityPresenter { case VendorFields.postalCode: return Text(vendor!.postalCode); case VendorFields.countryId: - return Text(state.staticState.countryMap[vendor!.countryId]?.name ?? ''); + return Text( + state.staticState.countryMap[vendor!.countryId]?.name ?? ''); case VendorFields.privateNotes: return TableTooltip(message: vendor!.privateNotes); case VendorFields.publicNotes: diff --git a/lib/ui/webhook/edit/webhook_edit.dart b/lib/ui/webhook/edit/webhook_edit.dart index 557365997..d14dd600b 100644 --- a/lib/ui/webhook/edit/webhook_edit.dart +++ b/lib/ui/webhook/edit/webhook_edit.dart @@ -97,7 +97,8 @@ class _WebhookEditState extends State { return EditScaffold( entity: webhook, - title: webhook.isNew ? localization!.newWebhook : localization!.editWebhook, + title: + webhook.isNew ? localization!.newWebhook : localization!.editWebhook, onCancelPressed: (context) => viewModel.onCancelPressed(context), onSavePressed: _onSavePressed, body: Form( diff --git a/lib/utils/designs.dart b/lib/utils/designs.dart index b86fc0cb7..d1b81d6c0 100644 --- a/lib/utils/designs.dart +++ b/lib/utils/designs.dart @@ -50,8 +50,7 @@ void loadDesign({ .then((dynamic response) { if ((response as Response).statusCode >= 400) { showErrorDialog( - message: - '${response.statusCode}: ${response.reasonPhrase}'); + message: '${response.statusCode}: ${response.reasonPhrase}'); onComplete(null); } else { onComplete(response); diff --git a/lib/utils/markdown.dart b/lib/utils/markdown.dart index a9e83b079..2ddf55ff1 100644 --- a/lib/utils/markdown.dart +++ b/lib/utils/markdown.dart @@ -588,4 +588,4 @@ class _EmptyParagraphSyntax extends md.BlockSyntax { return md.Element('p', []); } } -*/ \ No newline at end of file +*/ diff --git a/lib/utils/super_editor/toolbar.dart b/lib/utils/super_editor/toolbar.dart index 56bfdb1e5..7939993bf 100644 --- a/lib/utils/super_editor/toolbar.dart +++ b/lib/utils/super_editor/toolbar.dart @@ -284,8 +284,8 @@ class _EditorToolbarState extends State { final selectionRange = SpanRange(start: selectionStart, end: selectionEnd - 1); - final textNode = - widget.editor!.document.getNodeById(selection.extent.nodeId) as TextNode; + final textNode = widget.editor!.document + .getNodeById(selection.extent.nodeId) as TextNode; final text = textNode.text; final overlappingLinkAttributions = text.getAttributionSpansInRange( @@ -308,8 +308,8 @@ class _EditorToolbarState extends State { final selectionRange = SpanRange(start: selectionStart, end: selectionEnd - 1); - final textNode = - widget.editor!.document.getNodeById(selection.extent.nodeId) as TextNode; + final textNode = widget.editor!.document + .getNodeById(selection.extent.nodeId) as TextNode; final text = textNode.text; final overlappingLinkAttributions = text.getAttributionSpansInRange( @@ -367,8 +367,8 @@ class _EditorToolbarState extends State { final selectionRange = TextRange(start: selectionStart, end: selectionEnd - 1); - final textNode = - widget.editor!.document.getNodeById(selection.extent.nodeId) as TextNode; + final textNode = widget.editor!.document + .getNodeById(selection.extent.nodeId) as TextNode; final text = textNode.text; final trimmedRange = _trimTextRangeWhitespace(text, selectionRange); @@ -383,8 +383,8 @@ class _EditorToolbarState extends State { _urlController!.clear(); setState(() { _showUrlField = false; - _urlFocusNode!.unfocus( - disposition: UnfocusDisposition.previouslyFocusedChild); + _urlFocusNode! + .unfocus(disposition: UnfocusDisposition.previouslyFocusedChild); widget.closeToolbar(); }); }