From 63f5c6d583de72b3e37f9517dddf27bcaef17239 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 16 Nov 2021 16:20:44 +0200 Subject: [PATCH] Flutter upgrader --- lib/ui/app/actions_menu_button.dart | 2 +- lib/ui/app/app_bottom_bar.dart | 20 ++++++------- lib/ui/app/buttons/elevated_button.dart | 2 +- lib/ui/app/edit_scaffold.dart | 3 +- lib/ui/app/forms/app_tab_bar.dart | 2 +- lib/ui/app/forms/bool_dropdown_button.dart | 8 +++-- lib/ui/app/forms/help_link.dart | 4 +-- lib/ui/app/menu_drawer.dart | 9 +++--- lib/ui/app/tables/app_data_table.dart | 4 +-- lib/ui/app/tables/entity_list.dart | 11 ++++--- lib/ui/app/web_socket_refresh.dart | 15 ++++------ lib/ui/client/client_list_item.dart | 5 ++-- lib/ui/client/edit/client_edit_contacts.dart | 2 +- .../company_gateway_list_item.dart | 2 +- .../edit/company_gateway_edit.dart | 30 +++++++++---------- lib/ui/credit/credit_list_item.dart | 5 ++-- .../dashboard_date_range_picker.dart | 3 +- lib/ui/design/design_list_item.dart | 2 +- lib/ui/design/edit/design_edit.dart | 2 +- lib/ui/document/document_list_item.dart | 2 +- .../expense/edit/expense_edit_settings.dart | 10 +++---- lib/ui/expense/expense_list_item.dart | 5 ++-- .../expense_category_list_item.dart | 2 +- lib/ui/group/group_list_item.dart | 2 +- .../invoice/edit/invoice_edit_contacts.dart | 2 +- lib/ui/invoice/edit/invoice_edit_desktop.dart | 10 ++++--- lib/ui/invoice/edit/invoice_edit_details.dart | 4 +-- lib/ui/invoice/invoice_list_item.dart | 8 +++-- lib/ui/payment/edit/payment_edit.dart | 4 +-- lib/ui/payment/payment_list_item.dart | 5 ++-- lib/ui/payment/refund/payment_refund.dart | 4 +-- .../payment_term/payment_term_list_item.dart | 2 +- lib/ui/product/product_list_item.dart | 5 ++-- lib/ui/project/project_list_item.dart | 5 ++-- lib/ui/quote/quote_list_item.dart | 8 +++-- .../recurring_expense_list_item.dart | 5 ++-- .../recurring_invoice_list_item.dart | 8 +++-- lib/ui/settings/account_management.dart | 8 ++--- lib/ui/settings/client_portal.dart | 2 +- lib/ui/settings/custom_fields.dart | 2 +- lib/ui/settings/device_settings.dart | 8 ++--- lib/ui/settings/expense_settings.dart | 8 ++--- lib/ui/settings/import_export.dart | 6 ++-- lib/ui/settings/invoice_design.dart | 6 ++-- lib/ui/settings/localization_settings.dart | 2 +- lib/ui/settings/product_settings.dart | 16 +++++----- lib/ui/settings/task_settings.dart | 12 ++++---- .../subscription/subscription_list_item.dart | 2 +- lib/ui/task/task_list_item.dart | 5 ++-- lib/ui/task_status/task_status_list_item.dart | 2 +- lib/ui/tax_rate/tax_rate_list_item.dart | 2 +- lib/ui/token/token_list_item.dart | 2 +- lib/ui/user/edit/user_edit.dart | 4 +-- lib/ui/user/user_list_item.dart | 2 +- lib/ui/vendor/vendor_list_item.dart | 5 ++-- lib/ui/webhook/webhook_list_item.dart | 2 +- pubspec.foss.yaml | 1 + pubspec.last.yaml | 1 + pubspec.next.yaml | 1 + stubs/ui/stub/stub_list_item | 2 +- 60 files changed, 172 insertions(+), 151 deletions(-) diff --git a/lib/ui/app/actions_menu_button.dart b/lib/ui/app/actions_menu_button.dart index 00fa8511c..a556c032f 100644 --- a/lib/ui/app/actions_menu_button.dart +++ b/lib/ui/app/actions_menu_button.dart @@ -50,7 +50,7 @@ class ActionMenuButton extends StatelessWidget { children: [ Icon( getEntityActionIcon(action), - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, ), SizedBox(width: 16.0), Expanded( diff --git a/lib/ui/app/app_bottom_bar.dart b/lib/ui/app/app_bottom_bar.dart index 32d42897b..80fe01b8a 100644 --- a/lib/ui/app/app_bottom_bar.dart +++ b/lib/ui/app/app_bottom_bar.dart @@ -148,7 +148,7 @@ class _AppBottomBarState extends State { title: Text(AppLocalization.of(context).lookup('$state')), controlAffinity: ListTileControlAffinity.leading, value: stateFilters.contains(state), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, dense: true, onChanged: (value) { widget.onSelectedState(state, value); @@ -189,7 +189,7 @@ class _AppBottomBarState extends State { Text(AppLocalization.of(context).lookup(status.name)), controlAffinity: ListTileControlAffinity.leading, value: statusFilters.contains(status), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, dense: true, onChanged: (value) { widget.onSelectedStatus(status, value); @@ -239,7 +239,7 @@ class _AppBottomBarState extends State { : AppLocalization.of(context).descending) : null, groupValue: listUIState.sortField, - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, onChanged: (String value) { if (value == null && listUIState.sortField == field) { @@ -411,7 +411,7 @@ class _AppBottomBarState extends State { color: store.state .getListState(widget.entityType) .hasStateFilters - ? Theme.of(context).accentColor + ? Theme.of(context).colorScheme.secondary : null, ), if (widget.statuses.isNotEmpty) @@ -422,7 +422,7 @@ class _AppBottomBarState extends State { color: store.state .getListState(widget.entityType) .hasStatusFilters - ? Theme.of(context).accentColor + ? Theme.of(context).colorScheme.secondary : null, ), if (widget.customValues1.isNotEmpty) @@ -433,7 +433,7 @@ class _AppBottomBarState extends State { color: store.state .getListState(widget.entityType) .hasCustom1Filters - ? Theme.of(context).accentColor + ? Theme.of(context).colorScheme.secondary : null, ), if (widget.customValues2.isNotEmpty) @@ -444,7 +444,7 @@ class _AppBottomBarState extends State { color: store.state .getListState(widget.entityType) .hasCustom2Filters - ? Theme.of(context).accentColor + ? Theme.of(context).colorScheme.secondary : null, ), if (widget.customValues3.isNotEmpty) @@ -455,7 +455,7 @@ class _AppBottomBarState extends State { color: store.state .getListState(widget.entityType) .hasCustom3Filters - ? Theme.of(context).accentColor + ? Theme.of(context).colorScheme.secondary : null, ), if (widget.customValues4.isNotEmpty) @@ -466,7 +466,7 @@ class _AppBottomBarState extends State { color: store.state .getListState(widget.entityType) .hasCustom4Filters - ? Theme.of(context).accentColor + ? Theme.of(context).colorScheme.secondary : null, ), if (!widget.entityType.isSetting) @@ -556,7 +556,7 @@ class CustomFieldSelector extends StatelessWidget { title: Text(customField), controlAffinity: ListTileControlAffinity.leading, value: customFilters.contains(customField), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, dense: true, onChanged: (value) => onSelected(customField), ); diff --git a/lib/ui/app/buttons/elevated_button.dart b/lib/ui/app/buttons/elevated_button.dart index acb827b44..87f63becf 100644 --- a/lib/ui/app/buttons/elevated_button.dart +++ b/lib/ui/app/buttons/elevated_button.dart @@ -24,7 +24,7 @@ class AppButton extends StatelessWidget { Widget build(BuildContext context) { final button = ElevatedButton( style: ElevatedButton.styleFrom( - primary: color ?? Theme.of(context).buttonColor, + primary: color ?? Theme.of(context).colorScheme.secondary, padding: EdgeInsets.symmetric(vertical: 14, horizontal: 14), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(kBorderRadius)), diff --git a/lib/ui/app/edit_scaffold.dart b/lib/ui/app/edit_scaffold.dart index 410d506ce..68adc7f97 100644 --- a/lib/ui/app/edit_scaffold.dart +++ b/lib/ui/app/edit_scaffold.dart @@ -183,7 +183,8 @@ class EditScaffold extends StatelessWidget { children: [ Icon( getEntityActionIcon(action), - color: Theme.of(context).accentColor, + color: + Theme.of(context).colorScheme.secondary, ), SizedBox(width: 16.0), Text(AppLocalization.of(context) diff --git a/lib/ui/app/forms/app_tab_bar.dart b/lib/ui/app/forms/app_tab_bar.dart index b86f2ca8b..b4bf83383 100644 --- a/lib/ui/app/forms/app_tab_bar.dart +++ b/lib/ui/app/forms/app_tab_bar.dart @@ -29,7 +29,7 @@ class AppTabBar extends StatelessWidget { tabs: tabs, controller: controller, isScrollable: isScrollable, - indicatorColor: Theme.of(context).accentColor, + indicatorColor: Theme.of(context).colorScheme.secondary, onTap: onTap, ); diff --git a/lib/ui/app/forms/bool_dropdown_button.dart b/lib/ui/app/forms/bool_dropdown_button.dart index 3dcaffb56..5c03369d3 100644 --- a/lib/ui/app/forms/bool_dropdown_button.dart +++ b/lib/ui/app/forms/bool_dropdown_button.dart @@ -51,7 +51,7 @@ class BoolDropdownButton extends StatelessWidget { secondary: iconData != null && isDesktop(context) ? Icon(iconData) : null, onChanged: (value) => onChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, subtitle: helpLabel != null ? Text(helpLabel) : null, ), ); @@ -104,7 +104,8 @@ class BoolDropdownButton extends StatelessWidget { value: false, onChanged: (value) => null, groupValue: value, - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), Text(falseLabel), @@ -125,7 +126,8 @@ class BoolDropdownButton extends StatelessWidget { value: true, onChanged: (value) => null, groupValue: value, - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), Text(trueLabel), diff --git a/lib/ui/app/forms/help_link.dart b/lib/ui/app/forms/help_link.dart index 71c02e386..3a168dee2 100644 --- a/lib/ui/app/forms/help_link.dart +++ b/lib/ui/app/forms/help_link.dart @@ -22,8 +22,8 @@ class HelpLink extends StatelessWidget { final localization = AppLocalization.of(context); final ThemeData themeData = Theme.of(context); final TextStyle aboutTextStyle = themeData.textTheme.bodyText2; - final TextStyle linkStyle = - themeData.textTheme.bodyText2.copyWith(color: themeData.accentColor); + final TextStyle linkStyle = themeData.textTheme.bodyText2 + .copyWith(color: themeData.colorScheme.secondary); return Padding( padding: const EdgeInsets.only(top: 20, bottom: 30), diff --git a/lib/ui/app/menu_drawer.dart b/lib/ui/app/menu_drawer.dart index c0febd1c1..1bdbdb02f 100644 --- a/lib/ui/app/menu_drawer.dart +++ b/lib/ui/app/menu_drawer.dart @@ -760,7 +760,7 @@ class SidebarFooter extends StatelessWidget { tooltip: localization.updateAvailable, icon: Icon( Icons.warning, - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, ), onPressed: () => _showUpdate(context), ) @@ -934,7 +934,8 @@ class SidebarFooterCollapsed extends StatelessWidget { state.prefState.isFilterVisible ? PopupMenuButton( icon: isUpdateAvailable - ? Icon(Icons.warning, color: Theme.of(context).accentColor) + ? Icon(Icons.warning, + color: Theme.of(context).colorScheme.secondary) : Icon(Icons.info_outline), onSelected: (value) { if (value == localization.updateAvailable) { @@ -951,7 +952,7 @@ class SidebarFooterCollapsed extends StatelessWidget { child: ListTile( leading: Icon( Icons.warning, - color: Theme.of(context).accentColor, + color: Theme.of(context).colorScheme.secondary, ), title: Text(localization.updateAvailable), ), @@ -1400,7 +1401,7 @@ class _ContactUsDialogState extends State { setState(() => _includeLogs = value); }, title: Text(localization.includeRecentErrors), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ] ]), diff --git a/lib/ui/app/tables/app_data_table.dart b/lib/ui/app/tables/app_data_table.dart index e8b5280a5..2a6936d90 100644 --- a/lib/ui/app/tables/app_data_table.dart +++ b/lib/ui/app/tables/app_data_table.dart @@ -693,14 +693,14 @@ class AppDataTable extends StatelessWidget { tableColumns[0] = FixedColumnWidth( horizontalMargin + Checkbox.width + horizontalMargin / 2.0); tableRows[0].children[0] = _buildCheckbox( - color: theme.accentColor, + color: theme.colorScheme.secondary, checked: allChecked, onCheckboxChanged: _handleSelectAll, ); rowIndex = 1; for (final DataRow row in rows) { tableRows[rowIndex].children[0] = _buildCheckbox( - color: theme.accentColor, + color: theme.colorScheme.secondary, checked: row.selected, onRowTap: () => row.onSelectChanged != null ? row.onSelectChanged(!row.selected) diff --git a/lib/ui/app/tables/entity_list.dart b/lib/ui/app/tables/entity_list.dart index 190ae5b46..5e4507d29 100644 --- a/lib/ui/app/tables/entity_list.dart +++ b/lib/ui/app/tables/entity_list.dart @@ -379,7 +379,7 @@ class _EntityListState extends State { handleEntitiesActions( entities, EntityAction.toggleMultiselect); }, - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, value: entityList.length == (listUIState.selectedIds ?? []).length, ), @@ -448,11 +448,10 @@ class _EntityListState extends State { value: action, child: Row( children: [ - Icon( - getEntityActionIcon(action), - color: Theme.of(context) - .accentColor, - ), + Icon(getEntityActionIcon(action), + color: Theme.of(context) + .colorScheme + .secondary), SizedBox(width: 16.0), Text(AppLocalization.of(context) .lookup( diff --git a/lib/ui/app/web_socket_refresh.dart b/lib/ui/app/web_socket_refresh.dart index f4c82d253..4c7566bf8 100644 --- a/lib/ui/app/web_socket_refresh.dart +++ b/lib/ui/app/web_socket_refresh.dart @@ -1,21 +1,18 @@ // Dart imports: -import 'dart:convert'; -import 'dart:io'; +//import 'dart:convert'; +//import 'dart:io'; // Flutter imports: import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; // Package imports: -import 'package:flutter_redux/flutter_redux.dart'; +//import 'package:flutter_redux/flutter_redux.dart'; // Project imports: -import 'package:invoiceninja_flutter/data/web_client.dart'; -import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; -import 'package:invoiceninja_flutter/redux/app/app_state.dart'; - -/* -*/ +//import 'package:invoiceninja_flutter/data/web_client.dart'; +//import 'package:invoiceninja_flutter/redux/app/app_actions.dart'; +//import 'package:invoiceninja_flutter/redux/app/app_state.dart'; class WebSocketRefresh extends StatefulWidget { const WebSocketRefresh({ diff --git a/lib/ui/client/client_list_item.dart b/lib/ui/client/client_list_item.dart index 188ac40a4..f1111c1eb 100644 --- a/lib/ui/client/client_list_item.dart +++ b/lib/ui/client/client_list_item.dart @@ -90,7 +90,8 @@ class ClientListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), ) @@ -163,7 +164,7 @@ class ClientListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/client/edit/client_edit_contacts.dart b/lib/ui/client/edit/client_edit_contacts.dart index 910348f36..161b849ad 100644 --- a/lib/ui/client/edit/client_edit_contacts.dart +++ b/lib/ui/client/edit/client_edit_contacts.dart @@ -359,7 +359,7 @@ class ContactEditDetailsState extends State { Padding( padding: const EdgeInsets.only(top: 20), child: SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.addToInvoices), value: _sendEmail, onChanged: (value) { diff --git a/lib/ui/company_gateway/company_gateway_list_item.dart b/lib/ui/company_gateway/company_gateway_list_item.dart index 90e82911b..7eb862217 100644 --- a/lib/ui/company_gateway/company_gateway_list_item.dart +++ b/lib/ui/company_gateway/company_gateway_list_item.dart @@ -73,7 +73,7 @@ class CompanyGatewayListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/company_gateway/edit/company_gateway_edit.dart b/lib/ui/company_gateway/edit/company_gateway_edit.dart index ada771f13..88aaac44b 100644 --- a/lib/ui/company_gateway/edit/company_gateway_edit.dart +++ b/lib/ui/company_gateway/edit/company_gateway_edit.dart @@ -243,7 +243,7 @@ class _CompanyGatewayEditState extends State SwitchListTile( title: Text(localization .lookup(kGatewayTypes[gatewayTypeId] ?? '')), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, value: companyGateway .getSettingsForGatewayTypeId(gatewayTypeId) .isEnabled, @@ -267,7 +267,7 @@ class _CompanyGatewayEditState extends State ), ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.clientName), value: companyGateway.requireClientName, onChanged: (value) => viewModel.onChanged(companyGateway @@ -275,7 +275,7 @@ class _CompanyGatewayEditState extends State controlAffinity: ListTileControlAffinity.leading, ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.clientPhone), value: companyGateway.requireClientPhone, onChanged: (value) => viewModel.onChanged(companyGateway @@ -283,7 +283,7 @@ class _CompanyGatewayEditState extends State controlAffinity: ListTileControlAffinity.leading, ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.contactName), value: companyGateway.requireContactName, onChanged: (value) => viewModel.onChanged(companyGateway @@ -291,7 +291,7 @@ class _CompanyGatewayEditState extends State controlAffinity: ListTileControlAffinity.leading, ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.contactEmail), value: companyGateway.requireContactEmail, onChanged: (value) => viewModel.onChanged(companyGateway @@ -299,7 +299,7 @@ class _CompanyGatewayEditState extends State controlAffinity: ListTileControlAffinity.leading, ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.postalCode), value: companyGateway.requirePostalCode, onChanged: (value) => viewModel.onChanged(companyGateway @@ -307,7 +307,7 @@ class _CompanyGatewayEditState extends State controlAffinity: ListTileControlAffinity.leading, ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.cvv), value: companyGateway.requireCvv, onChanged: (value) => viewModel.onChanged( @@ -315,7 +315,7 @@ class _CompanyGatewayEditState extends State controlAffinity: ListTileControlAffinity.leading, ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.billingAddress), value: companyGateway.requireBillingAddress, onChanged: (value) => viewModel.onChanged(companyGateway @@ -323,7 +323,7 @@ class _CompanyGatewayEditState extends State controlAffinity: ListTileControlAffinity.leading, ), CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.shippingAddress), value: companyGateway.requireShippingAddress, onChanged: (value) => viewModel.onChanged(companyGateway @@ -332,7 +332,7 @@ class _CompanyGatewayEditState extends State ), SizedBox(height: 16), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.updateAddress), subtitle: Text(localization.updateAddressHelp), value: companyGateway.updateDetails, @@ -445,7 +445,7 @@ class CardListTile extends StatelessWidget { return CheckboxListTile( controlAffinity: ListTileControlAffinity.leading, - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(staticState.paymentTypeMap[paymentType]?.name ?? ''), value: companyGateway.supportsCard(cardType), onChanged: (value) => viewModel.onChanged(value @@ -611,7 +611,7 @@ class _GatewayConfigFieldState extends State { } else if (widget.defaultValue.runtimeType == bool) { return CheckboxListTile( controlAffinity: ListTileControlAffinity.leading, - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(toTitleCase(widget.field)), value: widget.value ?? false, onChanged: (value) => widget.onChanged(value), @@ -745,7 +745,7 @@ class _LimitEditorState extends State { CheckboxListTile( controlAffinity: ListTileControlAffinity.leading, contentPadding: const EdgeInsets.all(0), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(isDesktop(context) ? localization.enableMin : localization.enable), @@ -780,7 +780,7 @@ class _LimitEditorState extends State { CheckboxListTile( controlAffinity: ListTileControlAffinity.leading, contentPadding: const EdgeInsets.all(0), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(isDesktop(context) ? localization.enableMax : localization.enable), @@ -959,7 +959,7 @@ class _FeesEditorState extends State { ..feesAndLimitsMap[widget.gatewayTypeId] = settings.rebuild((b) => b..adjustFeePercent = value))), title: Text(localization.adjustFeePercent), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, subtitle: Text(localization.adjustFeePercentHelp), ), ), diff --git a/lib/ui/credit/credit_list_item.dart b/lib/ui/credit/credit_list_item.dart index b06653b4c..6536ebcff 100644 --- a/lib/ui/credit/credit_list_item.dart +++ b/lib/ui/credit/credit_list_item.dart @@ -98,7 +98,8 @@ class CreditListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ) : ActionMenuButton( @@ -179,7 +180,7 @@ class CreditListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/dashboard/dashboard_date_range_picker.dart b/lib/ui/dashboard/dashboard_date_range_picker.dart index 2a5665587..3ac01ba15 100644 --- a/lib/ui/dashboard/dashboard_date_range_picker.dart +++ b/lib/ui/dashboard/dashboard_date_range_picker.dart @@ -84,7 +84,8 @@ class _DashboardDateRangePickerState extends State { Text(localization.compare), Switch( value: _settings.enableComparison, - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, onChanged: (value) { setState( () => _settings.enableComparison = value); diff --git a/lib/ui/design/design_list_item.dart b/lib/ui/design/design_list_item.dart index 12a00099e..2bcf0f030 100644 --- a/lib/ui/design/design_list_item.dart +++ b/lib/ui/design/design_list_item.dart @@ -64,7 +64,7 @@ class DesignListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/design/edit/design_edit.dart b/lib/ui/design/edit/design_edit.dart index 6e9390746..f3178581f 100644 --- a/lib/ui/design/edit/design_edit.dart +++ b/lib/ui/design/edit/design_edit.dart @@ -473,7 +473,7 @@ class _DesignSettingsState extends State { if (kIsWeb || isMobileOS()) ...[ SizedBox(height: 16), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.draftMode), subtitle: Text(localization.draftModeHelp), value: widget.draftMode, diff --git a/lib/ui/document/document_list_item.dart b/lib/ui/document/document_list_item.dart index 8e45a96e2..7d857331b 100644 --- a/lib/ui/document/document_list_item.dart +++ b/lib/ui/document/document_list_item.dart @@ -69,7 +69,7 @@ class DocumentListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/expense/edit/expense_edit_settings.dart b/lib/ui/expense/edit/expense_edit_settings.dart index abb71215f..b8f3dfaea 100644 --- a/lib/ui/expense/edit/expense_edit_settings.dart +++ b/lib/ui/expense/edit/expense_edit_settings.dart @@ -154,7 +154,7 @@ class ExpenseEditSettingsState extends State { expense.isInvoiced ? SizedBox() : SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.shouldBeInvoiced), subtitle: Text(localization.shouldBeInvoicedHelp), value: expense.shouldBeInvoiced, @@ -164,7 +164,7 @@ class ExpenseEditSettingsState extends State { }, ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.markPaid), value: _showPaymentFields, subtitle: Text(localization.markPaidHelp), @@ -219,7 +219,7 @@ class ExpenseEditSettingsState extends State { ) : SizedBox(), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.convertCurrency), subtitle: Text(localization.convertCurrencyHelp), value: _showConvertCurrencyFields, @@ -288,7 +288,7 @@ class ExpenseEditSettingsState extends State { ) : SizedBox(), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.addDocumentsToInvoice), subtitle: Text(localization.addDocumentsToInvoiceHelp), value: expense.invoiceDocuments, @@ -334,7 +334,7 @@ class ExpenseEditSettingsState extends State { ), SizedBox(height: 16), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.inclusiveTaxes), value: expense.usesInclusiveTaxes, subtitle: Text( diff --git a/lib/ui/expense/expense_list_item.dart b/lib/ui/expense/expense_list_item.dart index 9fa8fc9e4..4cbc59b16 100644 --- a/lib/ui/expense/expense_list_item.dart +++ b/lib/ui/expense/expense_list_item.dart @@ -121,7 +121,8 @@ class ExpenseListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), ) @@ -202,7 +203,7 @@ class ExpenseListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/expense_category/expense_category_list_item.dart b/lib/ui/expense_category/expense_category_list_item.dart index 9525f616c..5dce02d15 100644 --- a/lib/ui/expense_category/expense_category_list_item.dart +++ b/lib/ui/expense_category/expense_category_list_item.dart @@ -69,7 +69,7 @@ class ExpenseCategoryListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/group/group_list_item.dart b/lib/ui/group/group_list_item.dart index 1aac5e855..43d1f5d74 100644 --- a/lib/ui/group/group_list_item.dart +++ b/lib/ui/group/group_list_item.dart @@ -65,7 +65,7 @@ class GroupListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/invoice/edit/invoice_edit_contacts.dart b/lib/ui/invoice/edit/invoice_edit_contacts.dart index 069ac4bac..6df01b66c 100644 --- a/lib/ui/invoice/edit/invoice_edit_contacts.dart +++ b/lib/ui/invoice/edit/invoice_edit_contacts.dart @@ -82,7 +82,7 @@ class _ContactListTile extends StatelessWidget { onTap: onTap, leading: IgnorePointer( child: Checkbox( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, value: invitation != null, onChanged: (value) => null, ), diff --git a/lib/ui/invoice/edit/invoice_edit_desktop.dart b/lib/ui/invoice/edit/invoice_edit_desktop.dart index 8db18035f..0270bd33a 100644 --- a/lib/ui/invoice/edit/invoice_edit_desktop.dart +++ b/lib/ui/invoice/edit/invoice_edit_desktop.dart @@ -693,8 +693,9 @@ class InvoiceEditDesktopState extends State padding: const EdgeInsets.only(top: 8), child: SwitchListTile( - activeColor: - Theme.of(context).accentColor, + activeColor: Theme.of(context) + .colorScheme + .secondary, title: Text( localization.inclusiveTaxes), dense: true, @@ -719,8 +720,9 @@ class InvoiceEditDesktopState extends State padding: const EdgeInsets.only(top: 8), child: SwitchListTile( - activeColor: - Theme.of(context).accentColor, + activeColor: Theme.of(context) + .colorScheme + .secondary, title: Text( localization.autoBillEnabled), dense: true, diff --git a/lib/ui/invoice/edit/invoice_edit_details.dart b/lib/ui/invoice/edit/invoice_edit_details.dart index 5d3b60677..03116923c 100644 --- a/lib/ui/invoice/edit/invoice_edit_details.dart +++ b/lib/ui/invoice/edit/invoice_edit_details.dart @@ -424,7 +424,7 @@ class InvoiceEditDetailsState extends State { Padding( padding: const EdgeInsets.only(top: 8), child: SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.inclusiveTaxes), dense: true, value: invoice.usesInclusiveTaxes, @@ -438,7 +438,7 @@ class InvoiceEditDetailsState extends State { Padding( padding: const EdgeInsets.only(top: 8), child: SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.autoBillEnabled), dense: true, value: invoice.autoBillEnabled, diff --git a/lib/ui/invoice/invoice_list_item.dart b/lib/ui/invoice/invoice_list_item.dart index 886cd4be0..75b0b6644 100644 --- a/lib/ui/invoice/invoice_list_item.dart +++ b/lib/ui/invoice/invoice_list_item.dart @@ -103,8 +103,9 @@ class InvoiceListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: - Theme.of(context).accentColor, + activeColor: Theme.of(context) + .colorScheme + .secondary, ), ) : ActionMenuButton( @@ -190,7 +191,8 @@ class InvoiceListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/payment/edit/payment_edit.dart b/lib/ui/payment/edit/payment_edit.dart index 107462536..f01aee533 100644 --- a/lib/ui/payment/edit/payment_edit.dart +++ b/lib/ui/payment/edit/payment_edit.dart @@ -337,7 +337,7 @@ class _PaymentEditState extends State { children: [ if (payment.isNew) SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.sendEmail), value: payment.sendEmail ?? false, subtitle: Text(localization.emailReceipt), @@ -345,7 +345,7 @@ class _PaymentEditState extends State { .onChanged(payment.rebuild((b) => b..sendEmail = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.convertCurrency), value: _showConvertCurrency, onChanged: (value) { diff --git a/lib/ui/payment/payment_list_item.dart b/lib/ui/payment/payment_list_item.dart index 86b0d72da..6ae9baa43 100644 --- a/lib/ui/payment/payment_list_item.dart +++ b/lib/ui/payment/payment_list_item.dart @@ -98,7 +98,8 @@ class PaymentListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ) : ActionMenuButton( @@ -173,7 +174,7 @@ class PaymentListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/payment/refund/payment_refund.dart b/lib/ui/payment/refund/payment_refund.dart index 9d71fe316..8a250df57 100644 --- a/lib/ui/payment/refund/payment_refund.dart +++ b/lib/ui/payment/refund/payment_refund.dart @@ -143,7 +143,7 @@ class _PaymentRefundState extends State { FormCard( children: [ SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.sendEmail), value: payment.sendEmail ?? false, subtitle: Text(localization.emailReceipt), @@ -152,7 +152,7 @@ class _PaymentRefundState extends State { ), if (gateway.supportsRefunds) SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.gatewayRefund), value: payment.gatewayRefund ?? false, subtitle: Text(localization.gatewayRefundHelp), diff --git a/lib/ui/payment_term/payment_term_list_item.dart b/lib/ui/payment_term/payment_term_list_item.dart index 05800319f..775f844bf 100644 --- a/lib/ui/payment_term/payment_term_list_item.dart +++ b/lib/ui/payment_term/payment_term_list_item.dart @@ -73,7 +73,7 @@ class PaymentTermListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/product/product_list_item.dart b/lib/ui/product/product_list_item.dart index a363d172f..e351048b8 100644 --- a/lib/ui/product/product_list_item.dart +++ b/lib/ui/product/product_list_item.dart @@ -90,7 +90,8 @@ class ProductListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ) : ActionMenuButton( @@ -163,7 +164,7 @@ class ProductListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/project/project_list_item.dart b/lib/ui/project/project_list_item.dart index d2f60ac04..38b139b39 100644 --- a/lib/ui/project/project_list_item.dart +++ b/lib/ui/project/project_list_item.dart @@ -94,7 +94,8 @@ class ProjectListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), ) @@ -175,7 +176,7 @@ class ProjectListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/quote/quote_list_item.dart b/lib/ui/quote/quote_list_item.dart index 9eb8c0b8e..830524b33 100644 --- a/lib/ui/quote/quote_list_item.dart +++ b/lib/ui/quote/quote_list_item.dart @@ -94,8 +94,9 @@ class QuoteListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: - Theme.of(context).accentColor, + activeColor: Theme.of(context) + .colorScheme + .secondary, ), ) : ActionMenuButton( @@ -177,7 +178,8 @@ class QuoteListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/recurring_expense/recurring_expense_list_item.dart b/lib/ui/recurring_expense/recurring_expense_list_item.dart index 526c07b2d..0d51a76e9 100644 --- a/lib/ui/recurring_expense/recurring_expense_list_item.dart +++ b/lib/ui/recurring_expense/recurring_expense_list_item.dart @@ -122,7 +122,8 @@ class RecurringExpenseListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), ) @@ -203,7 +204,7 @@ class RecurringExpenseListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/recurring_invoice/recurring_invoice_list_item.dart b/lib/ui/recurring_invoice/recurring_invoice_list_item.dart index 3bcb7b3ac..ab84b136a 100644 --- a/lib/ui/recurring_invoice/recurring_invoice_list_item.dart +++ b/lib/ui/recurring_invoice/recurring_invoice_list_item.dart @@ -102,8 +102,9 @@ class RecurringInvoiceListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: - Theme.of(context).accentColor, + activeColor: Theme.of(context) + .colorScheme + .secondary, ), ) : ActionMenuButton( @@ -185,7 +186,8 @@ class RecurringInvoiceListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => null, - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/settings/account_management.dart b/lib/ui/settings/account_management.dart index c46b9668b..64db0ce00 100644 --- a/lib/ui/settings/account_management.dart +++ b/lib/ui/settings/account_management.dart @@ -195,7 +195,7 @@ class _AccountManagementState extends State controlAffinity: ListTileControlAffinity.leading, title: Text(localization.lookup(kModules[module])), value: company.enabledModules & module != 0, - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, onChanged: (value) { int enabledModules = company.enabledModules; if (value) { @@ -361,7 +361,7 @@ class _AccountOverview extends StatelessWidget { }, title: Text(localization.activateCompany), subtitle: Text(localization.activateCompanyHelp), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), SwitchListTile( value: company.markdownEnabled, @@ -371,7 +371,7 @@ class _AccountOverview extends StatelessWidget { }, title: Text(localization.enableMarkdown), subtitle: Text(localization.enableMarkdownHelp), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), SwitchListTile( value: company.reportIncludeDrafts, @@ -381,7 +381,7 @@ class _AccountOverview extends StatelessWidget { }, title: Text(localization.includeDrafts), subtitle: Text(localization.includeDraftsHelp), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ], ), diff --git a/lib/ui/settings/client_portal.dart b/lib/ui/settings/client_portal.dart index 080f39809..e71d3ba52 100644 --- a/lib/ui/settings/client_portal.dart +++ b/lib/ui/settings/client_portal.dart @@ -494,7 +494,7 @@ class _ClientPortalState extends State isLast: true, children: company.clientRegistrationFields .map((field) => SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.lookup(field.key)), value: field.required, onChanged: (value) { diff --git a/lib/ui/settings/custom_fields.dart b/lib/ui/settings/custom_fields.dart index a8e709b0d..522c7be23 100644 --- a/lib/ui/settings/custom_fields.dart +++ b/lib/ui/settings/custom_fields.dart @@ -414,7 +414,7 @@ class _CustomFormFieldState extends State { children: [ IgnorePointer( child: Checkbox( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, value: widget.taxesEnabled ?? false, onChanged: (value) => null, ), diff --git a/lib/ui/settings/device_settings.dart b/lib/ui/settings/device_settings.dart index f72c81a2c..199bfe558 100644 --- a/lib/ui/settings/device_settings.dart +++ b/lib/ui/settings/device_settings.dart @@ -186,7 +186,7 @@ class _DeviceSettingsState extends State secondary: Icon(prefState.requireAuthentication ? MdiIcons.lock : MdiIcons.lockOpen), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ); } else { return SizedBox(); @@ -199,7 +199,7 @@ class _DeviceSettingsState extends State value: prefState.persistUI, onChanged: (value) => viewModel.onPersistUiChanged(context, value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, secondary: Icon(Icons.save_alt), ), SwitchListTile( @@ -208,7 +208,7 @@ class _DeviceSettingsState extends State value: prefState.persistData, onChanged: (value) => viewModel.onPersistDataChanged(context, value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, secondary: Icon(Icons.save_alt), ), ], @@ -264,7 +264,7 @@ class _DeviceSettingsState extends State secondary: Icon(kIsWeb ? Icons.lightbulb_outline : MdiIcons.themeLightDark), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), SizedBox(height: 16), AppDropdownButton( diff --git a/lib/ui/settings/expense_settings.dart b/lib/ui/settings/expense_settings.dart index cc817f2fe..e0ac7aefe 100644 --- a/lib/ui/settings/expense_settings.dart +++ b/lib/ui/settings/expense_settings.dart @@ -56,7 +56,7 @@ class _ExpenseSettingsState extends State { FormCard( children: [ SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.shouldBeInvoiced), value: company.markExpensesInvoiceable ?? false, subtitle: Text(localization.shouldBeInvoicedHelp), @@ -64,7 +64,7 @@ class _ExpenseSettingsState extends State { company.rebuild((b) => b..markExpensesInvoiceable = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.markPaid), value: company.markExpensesPaid ?? false, subtitle: Text(localization.markPaidHelp), @@ -72,7 +72,7 @@ class _ExpenseSettingsState extends State { company.rebuild((b) => b..markExpensesPaid = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.addDocumentsToInvoice), value: company.invoiceExpenseDocuments ?? false, subtitle: Text(localization.addDocumentsToInvoiceHelp), @@ -94,7 +94,7 @@ class _ExpenseSettingsState extends State { ), SizedBox(height: 16), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.inclusiveTaxes), value: company.expenseInclusiveTaxes ?? false, subtitle: Text( diff --git a/lib/ui/settings/import_export.dart b/lib/ui/settings/import_export.dart index b65d2bbec..a7b32fbbb 100644 --- a/lib/ui/settings/import_export.dart +++ b/lib/ui/settings/import_export.dart @@ -333,13 +333,13 @@ class _FileImportState extends State<_FileImport> { if (widget.importType == ImportType.json) { children.addAll([ SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.importSettings), value: _importJsonSettings, onChanged: (value) => setState(() => _importJsonSettings = value), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.importData), value: _importJsonData, onChanged: (value) => setState(() => _importJsonData = value), @@ -428,7 +428,7 @@ class __FileMapperState extends State<_FileMapper> { final List children = [ SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(AppLocalization.of(context).firstRowAsColumnNames), value: _useFirstRowAsHeaders, onChanged: (value) => setState(() => _useFirstRowAsHeaders = value), diff --git a/lib/ui/settings/invoice_design.dart b/lib/ui/settings/invoice_design.dart index ab1b7e357..31fc0af20 100644 --- a/lib/ui/settings/invoice_design.dart +++ b/lib/ui/settings/invoice_design.dart @@ -165,7 +165,7 @@ class _InvoiceDesignState extends State Padding( padding: const EdgeInsets.only(bottom: 8), child: CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.updateAllRecords), value: _updateAllInvoiceDesigns, onChanged: (value) => setState( @@ -192,7 +192,7 @@ class _InvoiceDesignState extends State Padding( padding: const EdgeInsets.only(bottom: 8), child: CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.updateAllRecords), value: _updateAllQuoteDesigns, onChanged: (value) => setState( @@ -219,7 +219,7 @@ class _InvoiceDesignState extends State Padding( padding: const EdgeInsets.only(bottom: 8), child: CheckboxListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.updateAllRecords), value: _updateAllCreditDesigns, onChanged: (value) => setState( diff --git a/lib/ui/settings/localization_settings.dart b/lib/ui/settings/localization_settings.dart index 77daebdea..f0185db3a 100644 --- a/lib/ui/settings/localization_settings.dart +++ b/lib/ui/settings/localization_settings.dart @@ -221,7 +221,7 @@ class _LocalizationSettingsState extends State }, title: Text(localization.decimalComma), subtitle: Text(localization.useCommaAsDecimalPlace), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, secondary: isDesktop(context) ? Icon(MdiIcons.commaCircle) : null, diff --git a/lib/ui/settings/product_settings.dart b/lib/ui/settings/product_settings.dart index f73b07a3c..5ad048ba8 100644 --- a/lib/ui/settings/product_settings.dart +++ b/lib/ui/settings/product_settings.dart @@ -54,7 +54,7 @@ class _ProductSettingsState extends State { FormCard( children: [ SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.showProductDiscount), value: company.enableProductDiscount, subtitle: Text(localization.showProductDiscountHelp), @@ -62,7 +62,7 @@ class _ProductSettingsState extends State { company.rebuild((b) => b..enableProductDiscount = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.showProductCost), value: company.enableProductCost, subtitle: Text(localization.showCostHelp), @@ -70,7 +70,7 @@ class _ProductSettingsState extends State { company.rebuild((b) => b..enableProductCost = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.showProductQuantity), value: company.enableProductQuantity, subtitle: Text(localization.showProductQuantityHelp), @@ -78,7 +78,7 @@ class _ProductSettingsState extends State { company.rebuild((b) => b..enableProductQuantity = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.defaultQuantity), value: company.defaultQuantity, subtitle: Text(localization.defaultQuantityHelp), @@ -92,7 +92,7 @@ class _ProductSettingsState extends State { children: [ /* SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.showProductDetails), value: company.showProductDetails, subtitle: Text(localization.showProductDetailsHelp), @@ -101,7 +101,7 @@ class _ProductSettingsState extends State { ), */ SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.fillProducts), value: company.fillProducts, subtitle: Text(localization.fillProductsHelp), @@ -109,7 +109,7 @@ class _ProductSettingsState extends State { company.rebuild((b) => b..fillProducts = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.updateProducts), value: company.updateProducts, subtitle: Text(localization.updateProductsHelp), @@ -117,7 +117,7 @@ class _ProductSettingsState extends State { company.rebuild((b) => b..updateProducts = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.convertProducts), value: company.convertProductExchangeRate ?? false, subtitle: Text(localization.convertProductsHelp), diff --git a/lib/ui/settings/task_settings.dart b/lib/ui/settings/task_settings.dart index 5fc994c63..19d4094fd 100644 --- a/lib/ui/settings/task_settings.dart +++ b/lib/ui/settings/task_settings.dart @@ -104,7 +104,7 @@ class _TaskSettingsState extends State { if (!viewModel.state.settingsUIState.isFiltered) ...[ SizedBox(height: 32), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.autoStartTasks), value: company.autoStartTasks, subtitle: Text(localization.autoStartTasksHelp), @@ -112,7 +112,7 @@ class _TaskSettingsState extends State { company.rebuild((b) => b..autoStartTasks = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.showTaskEndDate), value: company.showTaskEndDate, subtitle: Text(localization.showTaskEndDateHelp), @@ -125,7 +125,7 @@ class _TaskSettingsState extends State { children: [ if (!viewModel.state.settingsUIState.isFiltered) ...[ SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.showTasksTable), value: company.showTasksTable, subtitle: Text(localization.showTasksTableHelp), @@ -133,7 +133,7 @@ class _TaskSettingsState extends State { company.rebuild((b) => b..showTasksTable = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.invoiceTaskDatelog), value: company.invoiceTaskDatelog, subtitle: Text(localization.invoiceTaskDatelogHelp), @@ -141,7 +141,7 @@ class _TaskSettingsState extends State { company.rebuild((b) => b..invoiceTaskDatelog = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.invoiceTaskTimelog), value: company.invoiceTaskTimelog, subtitle: Text(localization.invoiceTaskTimelogHelp), @@ -149,7 +149,7 @@ class _TaskSettingsState extends State { company.rebuild((b) => b..invoiceTaskTimelog = value)), ), SwitchListTile( - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, title: Text(localization.addDocumentsToInvoice), value: company.invoiceTaskDocuments ?? false, subtitle: Text(localization.addDocumentsToInvoiceHelp), diff --git a/lib/ui/subscription/subscription_list_item.dart b/lib/ui/subscription/subscription_list_item.dart index 2a1c956c4..a3695b93d 100644 --- a/lib/ui/subscription/subscription_list_item.dart +++ b/lib/ui/subscription/subscription_list_item.dart @@ -70,7 +70,7 @@ class SubscriptionListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/task/task_list_item.dart b/lib/ui/task/task_list_item.dart index 17c18b7eb..9eeab72d2 100644 --- a/lib/ui/task/task_list_item.dart +++ b/lib/ui/task/task_list_item.dart @@ -135,7 +135,8 @@ class TaskListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), ) @@ -215,7 +216,7 @@ class TaskListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/task_status/task_status_list_item.dart b/lib/ui/task_status/task_status_list_item.dart index 5b15b728a..e2307c59e 100644 --- a/lib/ui/task_status/task_status_list_item.dart +++ b/lib/ui/task_status/task_status_list_item.dart @@ -70,7 +70,7 @@ class TaskStatusListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/tax_rate/tax_rate_list_item.dart b/lib/ui/tax_rate/tax_rate_list_item.dart index 4eba3eef3..039da601c 100644 --- a/lib/ui/tax_rate/tax_rate_list_item.dart +++ b/lib/ui/tax_rate/tax_rate_list_item.dart @@ -66,7 +66,7 @@ class TaxRateListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/token/token_list_item.dart b/lib/ui/token/token_list_item.dart index 438fe4b67..48fe11ab2 100644 --- a/lib/ui/token/token_list_item.dart +++ b/lib/ui/token/token_list_item.dart @@ -69,7 +69,7 @@ class TokenListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/user/edit/user_edit.dart b/lib/ui/user/edit/user_edit.dart index c83d4867c..f829f0c46 100644 --- a/lib/ui/user/edit/user_edit.dart +++ b/lib/ui/user/edit/user_edit.dart @@ -279,7 +279,7 @@ class _UserEditState extends State value: userCompany.isAdmin ?? false, onChanged: (value) => viewModel.onUserChanged( user.rebuild((b) => b..userCompany.isAdmin = value)), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ], ), @@ -450,7 +450,7 @@ class _PermissionCheckbox extends StatelessWidget { ? true : (userCompany.permissions ?? '').contains(permission), onChanged: checkAll ? null : onChanged, - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ); } } diff --git a/lib/ui/user/user_list_item.dart b/lib/ui/user/user_list_item.dart index 0c1f4eb2c..59177ecc8 100644 --- a/lib/ui/user/user_list_item.dart +++ b/lib/ui/user/user_list_item.dart @@ -64,7 +64,7 @@ class UserListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/vendor/vendor_list_item.dart b/lib/ui/vendor/vendor_list_item.dart index 45726793d..6f5621db5 100644 --- a/lib/ui/vendor/vendor_list_item.dart +++ b/lib/ui/vendor/vendor_list_item.dart @@ -91,7 +91,8 @@ class VendorListItem extends StatelessWidget { MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: + Theme.of(context).colorScheme.secondary, ), ), ) @@ -170,7 +171,7 @@ class VendorListItem extends StatelessWidget { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/lib/ui/webhook/webhook_list_item.dart b/lib/ui/webhook/webhook_list_item.dart index 904dbcec5..737e0ac9e 100644 --- a/lib/ui/webhook/webhook_list_item.dart +++ b/lib/ui/webhook/webhook_list_item.dart @@ -71,7 +71,7 @@ class WebhookListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null, diff --git a/pubspec.foss.yaml b/pubspec.foss.yaml index c46cd0ab1..6fbe10e67 100644 --- a/pubspec.foss.yaml +++ b/pubspec.foss.yaml @@ -76,6 +76,7 @@ dev_dependencies: built_value_generator: ^8.1.1 faker: ^2.0.0 msix: ^2.1.3 + import_sorter: ^4.6.0 flutter: diff --git a/pubspec.last.yaml b/pubspec.last.yaml index 199c8750d..9a7d9f05e 100644 --- a/pubspec.last.yaml +++ b/pubspec.last.yaml @@ -76,6 +76,7 @@ dev_dependencies: built_value_generator: ^8.1.1 faker: ^2.0.0 msix: ^2.1.3 + import_sorter: ^4.6.0 flutter: diff --git a/pubspec.next.yaml b/pubspec.next.yaml index b0df1aee2..bf26ca14b 100644 --- a/pubspec.next.yaml +++ b/pubspec.next.yaml @@ -76,6 +76,7 @@ dev_dependencies: built_value_generator: ^8.1.1 faker: ^2.0.0 msix: ^2.1.3 + import_sorter: ^4.6.0 flutter: diff --git a/stubs/ui/stub/stub_list_item b/stubs/ui/stub/stub_list_item index 5ccb03293..d0be399eb 100644 --- a/stubs/ui/stub/stub_list_item +++ b/stubs/ui/stub/stub_list_item @@ -63,7 +63,7 @@ class StubListItem extends StatelessWidget { value: isChecked, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, onChanged: (value) => onCheckboxChanged(value), - activeColor: Theme.of(context).accentColor, + activeColor: Theme.of(context).colorScheme.secondary, ), ) : null,