From 67ef9c152cbac988c50873cc27c0a9d13d230ed3 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 9 Feb 2021 11:45:10 +0200 Subject: [PATCH] Update buttons types --- lib/redux/credit/credit_actions.dart | 2 +- lib/redux/invoice/invoice_actions.dart | 2 +- lib/redux/quote/quote_actions.dart | 2 +- lib/ui/app/app_bottom_bar.dart | 2 +- lib/ui/app/buttons/action_flat_button.dart | 6 ++--- lib/ui/app/buttons/edit_icon_button.dart | 2 +- lib/ui/app/change_layout_banner.dart | 4 ++-- lib/ui/app/dialogs/alert_dialog.dart | 6 ++--- lib/ui/app/dialogs/error_dialog.dart | 6 ++--- lib/ui/app/dialogs/health_check_dialog.dart | 6 ++--- lib/ui/app/dialogs/multiselect_dialog.dart | 8 +++---- lib/ui/app/document_grid.dart | 8 +++---- lib/ui/app/forms/color_picker.dart | 4 ++-- lib/ui/app/forms/learn_more.dart | 4 ++-- lib/ui/app/forms/save_cancel_buttons.dart | 4 ++-- lib/ui/app/list_scaffold.dart | 2 +- lib/ui/app/main_screen.dart | 10 ++++----- lib/ui/app/menu_drawer.dart | 22 +++++++++---------- .../app/tables/app_paginated_data_table.dart | 2 +- lib/ui/app/tables/entity_datatable.dart | 2 +- lib/ui/app/upgrade_dialog.dart | 4 ++-- lib/ui/app/variables.dart | 2 +- lib/ui/app/view_scaffold.dart | 2 +- lib/ui/auth/login_view.dart | 4 ++-- lib/ui/client/edit/client_edit_contacts.dart | 4 ++-- .../company_gateway_list_item.dart | 2 +- .../company_gateway_screen.dart | 2 +- lib/ui/dashboard/dashboard_panels.dart | 2 +- lib/ui/invoice/edit/invoice_edit_items.dart | 4 ++-- lib/ui/invoice/invoice_pdf.dart | 6 ++--- lib/ui/payment/edit/payment_edit.dart | 4 ++-- lib/ui/payment/refund/payment_refund.dart | 4 ++-- lib/ui/reports/reports_screen.dart | 4 ++-- lib/ui/settings/localization_settings.dart | 4 ++-- lib/ui/settings/settings_wizard.dart | 2 +- lib/ui/system/update_dialog.dart | 8 +++---- lib/ui/task/edit/task_edit_times.dart | 4 ++-- lib/ui/vendor/edit/vendor_edit_contacts.dart | 4 ++-- lib/utils/dialogs.dart | 12 +++++----- samples/form_keys.dart | 7 +++--- samples/form_redux.dart | 5 +++-- 41 files changed, 97 insertions(+), 97 deletions(-) diff --git a/lib/redux/credit/credit_actions.dart b/lib/redux/credit/credit_actions.dart index 3eba0c534..df89e9bc8 100644 --- a/lib/redux/credit/credit_actions.dart +++ b/lib/redux/credit/credit_actions.dart @@ -442,7 +442,7 @@ Future handleCreditAction( context: context, message: localization.clientEmailNotSet, secondaryActions: [ - FlatButton( + TextButton( onPressed: () { Navigator.of(context).pop(); editEntity( diff --git a/lib/redux/invoice/invoice_actions.dart b/lib/redux/invoice/invoice_actions.dart index 6b41309ff..d8635b449 100644 --- a/lib/redux/invoice/invoice_actions.dart +++ b/lib/redux/invoice/invoice_actions.dart @@ -548,7 +548,7 @@ void handleInvoiceAction(BuildContext context, List invoices, context: context, message: localization.clientEmailNotSet, secondaryActions: [ - FlatButton( + TextButton( onPressed: () { Navigator.of(context).pop(); editEntity( diff --git a/lib/redux/quote/quote_actions.dart b/lib/redux/quote/quote_actions.dart index 99207e1c0..a68779db3 100644 --- a/lib/redux/quote/quote_actions.dart +++ b/lib/redux/quote/quote_actions.dart @@ -466,7 +466,7 @@ Future handleQuoteAction( context: context, message: localization.clientEmailNotSet, secondaryActions: [ - FlatButton( + TextButton( onPressed: () { Navigator.of(context).pop(); editEntity( diff --git a/lib/ui/app/app_bottom_bar.dart b/lib/ui/app/app_bottom_bar.dart index 791a73894..e216c5e06 100644 --- a/lib/ui/app/app_bottom_bar.dart +++ b/lib/ui/app/app_bottom_bar.dart @@ -484,7 +484,7 @@ class _AppBottomBarState extends State { if (!state.prefState.isMenuFloated) Spacer(), if (!widget.entityType.isSetting && !isList) if (state.prefState.isDesktop) - FlatButton( + TextButton( onPressed: _onColumnsPressed, child: Text( localization.columns, diff --git a/lib/ui/app/buttons/action_flat_button.dart b/lib/ui/app/buttons/action_flat_button.dart index 294e7a02e..bdab4ffbb 100644 --- a/lib/ui/app/buttons/action_flat_button.dart +++ b/lib/ui/app/buttons/action_flat_button.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_redux/flutter_redux.dart'; import 'package:invoiceninja_flutter/redux/app/app_state.dart'; -class ActionFlatButton extends StatelessWidget { - const ActionFlatButton({ +class ActionTextButton extends StatelessWidget { + const ActionTextButton({ this.onPressed, this.tooltip, this.isSaving = false, @@ -45,7 +45,7 @@ class ActionFlatButton extends StatelessWidget { ); } - return FlatButton( + return TextButton( child: Text( tooltip, style: isHeader && onPressed != null diff --git a/lib/ui/app/buttons/edit_icon_button.dart b/lib/ui/app/buttons/edit_icon_button.dart index 027d528a9..1f9552203 100644 --- a/lib/ui/app/buttons/edit_icon_button.dart +++ b/lib/ui/app/buttons/edit_icon_button.dart @@ -21,7 +21,7 @@ class EditIconButton extends StatelessWidget { return Container(); } - return FlatButton( + return TextButton( child: Text( localization.edit, style: TextStyle(color: store.state.headerTextColor), diff --git a/lib/ui/app/change_layout_banner.dart b/lib/ui/app/change_layout_banner.dart index 25031245e..6b7cd8490 100644 --- a/lib/ui/app/change_layout_banner.dart +++ b/lib/ui/app/change_layout_banner.dart @@ -71,7 +71,7 @@ class _ChangeLayoutBannerState extends State { text: message, ), ), - FlatButton( + TextButton( child: Text( localization.dismiss, style: TextStyle(color: Colors.white), @@ -80,7 +80,7 @@ class _ChangeLayoutBannerState extends State { setState(() => _dismissedChange = true); }, ), - FlatButton( + TextButton( child: Text( localization.change, style: TextStyle(color: Colors.white), diff --git a/lib/ui/app/dialogs/alert_dialog.dart b/lib/ui/app/dialogs/alert_dialog.dart index 09bc9f9f5..0081cce8e 100644 --- a/lib/ui/app/dialogs/alert_dialog.dart +++ b/lib/ui/app/dialogs/alert_dialog.dart @@ -12,7 +12,7 @@ class MessageDialog extends StatelessWidget { final String message; final String dismissLabel; - final List secondaryActions; + final List secondaryActions; final Function onDismiss; final Function onDiscard; @@ -42,7 +42,7 @@ class MessageDialog extends StatelessWidget { if (onDiscard != null) Padding( padding: const EdgeInsets.only(right: 10), - child: FlatButton( + child: TextButton( autofocus: true, child: Text( localization.discardChanges.toUpperCase()), @@ -60,7 +60,7 @@ class MessageDialog extends StatelessWidget { )) .toList(), ), - FlatButton( + TextButton( onPressed: () { Navigator.of(context).pop(); if (onDismiss != null) { diff --git a/lib/ui/app/dialogs/error_dialog.dart b/lib/ui/app/dialogs/error_dialog.dart index 97c9cd901..725e4eb75 100644 --- a/lib/ui/app/dialogs/error_dialog.dart +++ b/lib/ui/app/dialogs/error_dialog.dart @@ -29,7 +29,7 @@ class ErrorDialog extends StatelessWidget { content: error != null ? SelectableText(errorStr.toString()) : SizedBox(), actions: [ if (clearErrorOnDismiss && !Config.DEMO_MODE) - FlatButton( + TextButton( child: Text(localization.logout.toUpperCase()), onPressed: () { confirmCallback( @@ -38,12 +38,12 @@ class ErrorDialog extends StatelessWidget { store.dispatch(UserLogout(context)); }); }), - FlatButton( + TextButton( child: Text(localization.copy.toUpperCase()), onPressed: () { Clipboard.setData(ClipboardData(text: errorStr)); }), - FlatButton( + TextButton( child: Text(localization.dismiss.toUpperCase()), onPressed: () { if (clearErrorOnDismiss) { diff --git a/lib/ui/app/dialogs/health_check_dialog.dart b/lib/ui/app/dialogs/health_check_dialog.dart index 789b47d1f..ceee8e6d7 100644 --- a/lib/ui/app/dialogs/health_check_dialog.dart +++ b/lib/ui/app/dialogs/health_check_dialog.dart @@ -152,15 +152,15 @@ class _HealthCheckDialogState extends State { actions: _response == null ? [] : [ - FlatButton( + TextButton( child: Text(localization.clearCache.toUpperCase()), onPressed: () => clearCache(), ), - FlatButton( + TextButton( child: Text(localization.refresh.toUpperCase()), onPressed: () => runCheck(), ), - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ) diff --git a/lib/ui/app/dialogs/multiselect_dialog.dart b/lib/ui/app/dialogs/multiselect_dialog.dart index f003f3f26..efbba49fa 100644 --- a/lib/ui/app/dialogs/multiselect_dialog.dart +++ b/lib/ui/app/dialogs/multiselect_dialog.dart @@ -206,7 +206,7 @@ class MultiSelectListState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - FlatButton( + TextButton( child: Text(localization.reset.toUpperCase()), onPressed: () { setState( @@ -228,7 +228,7 @@ class MultiSelectListState extends State { title: Text(localization.editColumns), content: column, actions: [ - FlatButton( + TextButton( child: Text(localization.reset.toUpperCase()), onPressed: () { setState(() => selected = widget.defaultSelected.toList()); @@ -236,12 +236,12 @@ class MultiSelectListState extends State { widget.onSelected(selected); } }), - FlatButton( + TextButton( child: Text(localization.cancel.toUpperCase()), onPressed: () { Navigator.pop(context); }), - FlatButton( + TextButton( child: Text(localization.save.toUpperCase()), onPressed: () { Navigator.pop(context); diff --git a/lib/ui/app/document_grid.dart b/lib/ui/app/document_grid.dart index 2cbfe66ed..b4a66d3b4 100644 --- a/lib/ui/app/document_grid.dart +++ b/lib/ui/app/document_grid.dart @@ -149,14 +149,14 @@ class DocumentTile extends StatelessWidget { title: Text(document.name), actions: [ isFromExpense && onViewExpense != null - ? FlatButton( + ? TextButton( child: Text(localization.expense.toUpperCase()), onPressed: () { Navigator.of(context).pop(); onViewExpense(document); }, ) - : FlatButton( + : TextButton( child: Text(localization.delete.toUpperCase()), onPressed: () { confirmCallback( @@ -171,7 +171,7 @@ class DocumentTile extends StatelessWidget { }); }, ), - FlatButton( + TextButton( child: Text(localization.download.toUpperCase()), onPressed: () async { final store = StoreProvider.of(context); @@ -202,7 +202,7 @@ class DocumentTile extends StatelessWidget { } }, ), - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () { Navigator.of(context).pop(); diff --git a/lib/ui/app/forms/color_picker.dart b/lib/ui/app/forms/color_picker.dart index 44043b586..09c3bca82 100644 --- a/lib/ui/app/forms/color_picker.dart +++ b/lib/ui/app/forms/color_picker.dart @@ -98,11 +98,11 @@ class _FormColorPickerState extends State { ), ), actions: [ - FlatButton( + TextButton( child: Text(localization.cancel.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ), - FlatButton( + TextButton( child: Text(localization.done.toUpperCase()), onPressed: () { _selectColor(_pendingColor); diff --git a/lib/ui/app/forms/learn_more.dart b/lib/ui/app/forms/learn_more.dart index c4761b075..8382e543e 100644 --- a/lib/ui/app/forms/learn_more.dart +++ b/lib/ui/app/forms/learn_more.dart @@ -27,7 +27,7 @@ class LearnMoreUrl extends StatelessWidget { SizedBox( width: 10, ), - FlatButton( + TextButton( child: Text(localization.learnMore), onPressed: () async { if (await canLaunch(url)) { @@ -63,7 +63,7 @@ class LearnMoreDialog extends StatelessWidget { SizedBox( width: 10, ), - FlatButton( + TextButton( child: Text(label ?? localization.learnMore), onPressed: () { showDialog( diff --git a/lib/ui/app/forms/save_cancel_buttons.dart b/lib/ui/app/forms/save_cancel_buttons.dart index 6fa5493bc..bffb7104b 100644 --- a/lib/ui/app/forms/save_cancel_buttons.dart +++ b/lib/ui/app/forms/save_cancel_buttons.dart @@ -34,7 +34,7 @@ class SaveCancelButtons extends StatelessWidget { children: [ if (onCancelPressed != null && !isSaving) Builder(builder: (BuildContext context) { - return FlatButton( + return TextButton( child: Text( cancelLabel ?? localization.cancel, style: isHeader && isEnabled @@ -48,7 +48,7 @@ class SaveCancelButtons extends StatelessWidget { }), SizedBox(width: 10), Builder(builder: (BuildContext context) { - return ActionFlatButton( + return ActionTextButton( tooltip: saveLabel ?? localization.save, isVisible: true, isSaving: isSaving, diff --git a/lib/ui/app/list_scaffold.dart b/lib/ui/app/list_scaffold.dart index d0dd82354..512abc956 100644 --- a/lib/ui/app/list_scaffold.dart +++ b/lib/ui/app/list_scaffold.dart @@ -99,7 +99,7 @@ class ListScaffold extends StatelessWidget { actions: [ ...appBarActions ?? [], if (isDesktop(context) && onCancelSettingsSection != null) - FlatButton( + TextButton( onPressed: () { store.dispatch(ViewSettings( navigator: Navigator.of(context), diff --git a/lib/ui/app/main_screen.dart b/lib/ui/app/main_screen.dart index fcf250952..d65a4f035 100644 --- a/lib/ui/app/main_screen.dart +++ b/lib/ui/app/main_screen.dart @@ -849,7 +849,7 @@ class _EntityFilter extends StatelessWidget { ) : Row( children: [ - SizedBox(width: 4), + SizedBox(width: 8), if (!state.prefState.showFilterSidebar) IconButton( tooltip: localization.showSidebar, @@ -860,10 +860,10 @@ class _EntityFilter extends StatelessWidget { onPressed: () => store.dispatch( UpdateUserPreferences(showFilterSidebar: true)), ), + SizedBox(width: 4), ConstrainedBox( constraints: BoxConstraints(maxWidth: 220), - child: FlatButton( - visualDensity: VisualDensity.compact, + child: TextButton( child: Text( EntityPresenter() .initialize(filterEntity, context) @@ -887,9 +887,7 @@ class _EntityFilter extends StatelessWidget { children: [ for (int i = 0; i < relatedTypes.length; i++) DecoratedBox( - child: FlatButton( - minWidth: 0, - visualDensity: VisualDensity.compact, + child: TextButton( child: Text( localization .lookup('${relatedTypes[i].plural}'), diff --git a/lib/ui/app/menu_drawer.dart b/lib/ui/app/menu_drawer.dart index e56c6a1ed..bd6058479 100644 --- a/lib/ui/app/menu_drawer.dart +++ b/lib/ui/app/menu_drawer.dart @@ -582,14 +582,14 @@ class SidebarFooter extends StatelessWidget { context: context, message: localization.cronsNotEnabled, secondaryActions: [ - FlatButton( + TextButton( child: Text(localization.learnMore.toUpperCase()), onPressed: () { launch(kCronsHelpUrl, forceSafariVC: false, forceWebView: false); }, ), - FlatButton( + TextButton( child: Text(localization.refreshData.toUpperCase()), onPressed: () { store.dispatch(RefreshData()); @@ -609,7 +609,7 @@ class SidebarFooter extends StatelessWidget { context: context, message: localization.companyDisabledWarning, secondaryActions: [ - FlatButton( + TextButton( child: Text(localization.viewSettings.toUpperCase()), onPressed: () { store.dispatch(ViewSettings( @@ -699,7 +699,7 @@ class SidebarFooter extends StatelessWidget { if (isHosted(context) && !isPaidAccount(context)) ...[ Spacer(), - FlatButton( + TextButton( child: Text(localization.upgrade), color: Colors.green, onPressed: () => showDialog( @@ -857,7 +857,7 @@ void _showAbout(BuildContext context) async { builder: (BuildContext context) { return AlertDialog( actions: [ - FlatButton( + TextButton( child: Text(localization.viewLicenses.toUpperCase()), onPressed: () => showLicensePage( context: context, @@ -867,7 +867,7 @@ void _showAbout(BuildContext context) async { applicationVersion: state.appVersion, ), ), - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ), @@ -938,7 +938,7 @@ void _showAbout(BuildContext context) async { builder: (BuildContext context) { return AlertDialog( actions: [ - FlatButton( + TextButton( child: Text(localization.sourceCode.toUpperCase()), onPressed: () { @@ -947,7 +947,7 @@ void _showAbout(BuildContext context) async { builder: (BuildContext context) { return AlertDialog( actions: [ - FlatButton( + TextButton( child: Text(localization.close .toUpperCase()), onPressed: () => @@ -990,7 +990,7 @@ void _showAbout(BuildContext context) async { ); }, ), - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ), @@ -1120,12 +1120,12 @@ class _ContactUsDialogState extends State { child: CircularProgressIndicator(), ), if (!_isSaving) - FlatButton( + TextButton( child: Text(localization.cancel.toUpperCase()), onPressed: () => Navigator.pop(context), ), if (!_isSaving) - FlatButton( + TextButton( child: Text(localization.send.toUpperCase()), onPressed: () => _sendMessage(), ), diff --git a/lib/ui/app/tables/app_paginated_data_table.dart b/lib/ui/app/tables/app_paginated_data_table.dart index b8dad1d3d..13081135b 100644 --- a/lib/ui/app/tables/app_paginated_data_table.dart +++ b/lib/ui/app/tables/app_paginated_data_table.dart @@ -104,7 +104,7 @@ class AppPaginatedDataTable extends StatefulWidget { /// The table card's header. /// /// This is typically a [Text] widget, but can also be a [ButtonBar] with - /// [FlatButton]s. Suitable defaults are automatically provided for the font, + /// [TextButton]s. Suitable defaults are automatically provided for the font, /// button color, button padding, and so forth. /// /// If items in the table are selectable, then, when the selection is not diff --git a/lib/ui/app/tables/entity_datatable.dart b/lib/ui/app/tables/entity_datatable.dart index e4e4269b2..533dca777 100644 --- a/lib/ui/app/tables/entity_datatable.dart +++ b/lib/ui/app/tables/entity_datatable.dart @@ -154,7 +154,7 @@ class DatatableHeader extends StatelessWidget { return Row( children: [ - FlatButton( + TextButton( child: Text(localization.refresh), onPressed: onRefreshPressed, ), diff --git a/lib/ui/app/upgrade_dialog.dart b/lib/ui/app/upgrade_dialog.dart index 8797cdced..5be069d5a 100644 --- a/lib/ui/app/upgrade_dialog.dart +++ b/lib/ui/app/upgrade_dialog.dart @@ -200,11 +200,11 @@ class _UpgradeDialogState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - FlatButton( + TextButton( child: Text('Terms', style: TextStyle(fontSize: 12)), onPressed: () => launch(kTermsOfServiceURL), ), - FlatButton( + TextButton( child: Text('Privacy', style: TextStyle(fontSize: 12)), onPressed: () => launch(kPrivacyPolicyURL), ), diff --git a/lib/ui/app/variables.dart b/lib/ui/app/variables.dart index 18d10c94f..d604daa88 100644 --- a/lib/ui/app/variables.dart +++ b/lib/ui/app/variables.dart @@ -209,7 +209,7 @@ class _VariableGrid extends StatelessWidget { childAspectRatio: 4, children: fields .map( - (field) => FlatButton( + (field) => TextButton( child: Align( alignment: Alignment.centerLeft, child: Text( diff --git a/lib/ui/app/view_scaffold.dart b/lib/ui/app/view_scaffold.dart index 4e36af147..376c3f491 100644 --- a/lib/ui/app/view_scaffold.dart +++ b/lib/ui/app/view_scaffold.dart @@ -83,7 +83,7 @@ class ViewScaffold extends StatelessWidget { ? [] : [ if (isSettings && isDesktop(context)) - FlatButton( + TextButton( onPressed: () { onBackPressed != null ? onBackPressed() diff --git a/lib/ui/auth/login_view.dart b/lib/ui/auth/login_view.dart index 1374c724f..5fa13e60e 100644 --- a/lib/ui/auth/login_view.dart +++ b/lib/ui/auth/login_view.dart @@ -188,7 +188,7 @@ class _LoginState extends State { actions: [ Padding( padding: const EdgeInsets.only(right: 8), - child: FlatButton( + child: TextButton( child: Text(AppLocalization.of(context).close), onPressed: () => Navigator.of(context).pop(), ), @@ -575,7 +575,7 @@ class _LoginState extends State { children: [ if (!_recoverPassword) Icon(MdiIcons.lock, size: 16), - FlatButton( + TextButton( child: Text(_recoverPassword ? localization.cancel : localization.recoverPassword), diff --git a/lib/ui/client/edit/client_edit_contacts.dart b/lib/ui/client/edit/client_edit_contacts.dart index 04e97ce1e..733573ec0 100644 --- a/lib/ui/client/edit/client_edit_contacts.dart +++ b/lib/ui/client/edit/client_edit_contacts.dart @@ -371,7 +371,7 @@ class ContactEditDetailsState extends State { ? AlertDialog( content: SingleChildScrollView(child: column), actions: [ - FlatButton( + TextButton( child: Text(localization.remove.toUpperCase()), onPressed: () => confirmCallback( context: context, @@ -380,7 +380,7 @@ class ContactEditDetailsState extends State { Navigator.pop(context); }), ), - FlatButton( + TextButton( child: Text(localization.done.toUpperCase()), onPressed: () => _onDoneContactPressed(), ) diff --git a/lib/ui/company_gateway/company_gateway_list_item.dart b/lib/ui/company_gateway/company_gateway_list_item.dart index cbf9703da..e4f2e573a 100644 --- a/lib/ui/company_gateway/company_gateway_list_item.dart +++ b/lib/ui/company_gateway/company_gateway_list_item.dart @@ -53,7 +53,7 @@ class CompanyGatewayListItem extends StatelessWidget { onTap: () => selectEntity(entity: companyGateway, context: context), trailing: onRemovePressed == null ? null - : FlatButton( + : TextButton( child: Text(AppLocalization.of(context).remove), onPressed: onRemovePressed, ), diff --git a/lib/ui/company_gateway/company_gateway_screen.dart b/lib/ui/company_gateway/company_gateway_screen.dart index 4e682eb94..a5953c881 100644 --- a/lib/ui/company_gateway/company_gateway_screen.dart +++ b/lib/ui/company_gateway/company_gateway_screen.dart @@ -66,7 +66,7 @@ class CompanyGatewayScreen extends StatelessWidget { ) else if (state.uiState.settingsUIState.isFiltered && !state.isSaving) ...[ - FlatButton( + TextButton( child: Text(localization.reset, style: TextStyle(color: store.state.headerTextColor)), onPressed: () { diff --git a/lib/ui/dashboard/dashboard_panels.dart b/lib/ui/dashboard/dashboard_panels.dart index 0d6c4e360..49c8e4b14 100644 --- a/lib/ui/dashboard/dashboard_panels.dart +++ b/lib/ui/dashboard/dashboard_panels.dart @@ -187,7 +187,7 @@ class DashboardPanels extends StatelessWidget { key: ValueKey( '__${settings.includeTaxes}_${settings.currencyId}__'), actions: [ - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ) diff --git a/lib/ui/invoice/edit/invoice_edit_items.dart b/lib/ui/invoice/edit/invoice_edit_items.dart index dc48eb54d..78870d581 100644 --- a/lib/ui/invoice/edit/invoice_edit_items.dart +++ b/lib/ui/invoice/edit/invoice_edit_items.dart @@ -234,7 +234,7 @@ class ItemEditDetailsState extends State { return AlertDialog( actions: [ - FlatButton( + TextButton( child: Text(localization.remove.toUpperCase()), onPressed: () => confirmCallback( context: context, @@ -243,7 +243,7 @@ class ItemEditDetailsState extends State { Navigator.of(context).pop(); }), ), - FlatButton( + TextButton( child: Text(localization.done.toUpperCase()), onPressed: () { viewModel.clearSelectedInvoiceItem(); diff --git a/lib/ui/invoice/invoice_pdf.dart b/lib/ui/invoice/invoice_pdf.dart index 1c5ca3cf8..9e297783a 100644 --- a/lib/ui/invoice/invoice_pdf.dart +++ b/lib/ui/invoice/invoice_pdf.dart @@ -222,7 +222,7 @@ class _InvoicePdfViewState extends State { if (isDesktop(context) && _activityId == null && !invoice.isRecurring) - FlatButton( + TextButton( child: Text(localization.email, style: TextStyle(color: state.headerTextColor)), onPressed: () { @@ -230,7 +230,7 @@ class _InvoicePdfViewState extends State { EntityAction.emailEntityType(invoice.entityType)); }, ), - FlatButton( + TextButton( child: Text( localization.download, style: TextStyle(color: state.headerTextColor), @@ -255,7 +255,7 @@ class _InvoicePdfViewState extends State { }, ), if (isDesktop(context)) - FlatButton( + TextButton( child: Text(localization.close, style: TextStyle(color: state.headerTextColor)), onPressed: () { diff --git a/lib/ui/payment/edit/payment_edit.dart b/lib/ui/payment/edit/payment_edit.dart index c94719daa..b5f63c151 100644 --- a/lib/ui/payment/edit/payment_edit.dart +++ b/lib/ui/payment/edit/payment_edit.dart @@ -305,11 +305,11 @@ class _PaymentEditState extends State { ), ) else ...[ - FlatButton( + TextButton( child: Text(localization.cancel.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ), - FlatButton( + TextButton( child: Text(localization.apply.toUpperCase()), onPressed: () => onSavePressed(context), ), diff --git a/lib/ui/payment/refund/payment_refund.dart b/lib/ui/payment/refund/payment_refund.dart index 83d23b8b2..a4f841258 100644 --- a/lib/ui/payment/refund/payment_refund.dart +++ b/lib/ui/payment/refund/payment_refund.dart @@ -212,11 +212,11 @@ class _PaymentRefundState extends State { ), ) else ...[ - FlatButton( + TextButton( child: Text(localization.cancel.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ), - FlatButton( + TextButton( child: Text(localization.refund.toUpperCase()), onPressed: () => onSavePressed(context), ), diff --git a/lib/ui/reports/reports_screen.dart b/lib/ui/reports/reports_screen.dart index e4b1cefe2..5498c8ae8 100644 --- a/lib/ui/reports/reports_screen.dart +++ b/lib/ui/reports/reports_screen.dart @@ -206,7 +206,7 @@ class ReportsScreen extends StatelessWidget { actions: [ if (isDesktop(context)) ...[ Builder(builder: (BuildContext context) { - return FlatButton( + return TextButton( child: Text( localization.columns, style: TextStyle(color: store.state.headerTextColor), @@ -224,7 +224,7 @@ class ReportsScreen extends StatelessWidget { }, ); }), - FlatButton( + TextButton( child: Text( localization.export, style: TextStyle(color: store.state.headerTextColor), diff --git a/lib/ui/settings/localization_settings.dart b/lib/ui/settings/localization_settings.dart index f12e1a30f..04c88f540 100644 --- a/lib/ui/settings/localization_settings.dart +++ b/lib/ui/settings/localization_settings.dart @@ -268,7 +268,7 @@ class _LocalizationSettingsState extends State ), ), SizedBox(width: 8), - FlatButton( + TextButton( child: Text(localization.addCustom), onPressed: () { fieldCallback( @@ -280,7 +280,7 @@ class _LocalizationSettingsState extends State field: localization.label, title: localization.addCustom, secondaryActions: [ - FlatButton( + TextButton( child: Text(localization.labels.toUpperCase()), onPressed: () => launch(kGitHubLangUrl), diff --git a/lib/ui/settings/settings_wizard.dart b/lib/ui/settings/settings_wizard.dart index 32c1fa5ca..1de054391 100644 --- a/lib/ui/settings/settings_wizard.dart +++ b/lib/ui/settings/settings_wizard.dart @@ -187,7 +187,7 @@ class _SettingsWizardState extends State { ), ), actions: [ - FlatButton( + TextButton( onPressed: _onSavePressed, child: Text(localization.save.toUpperCase())) ], diff --git a/lib/ui/system/update_dialog.dart b/lib/ui/system/update_dialog.dart index b8ddaf66a..32bcec946 100644 --- a/lib/ui/system/update_dialog.dart +++ b/lib/ui/system/update_dialog.dart @@ -87,27 +87,27 @@ class _UpdateDialogState extends State { ), actions: [ if (updateState == UpdateState.initial) ...[ - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () { Navigator.of(context).pop(); }, ), if (!account.isUpdateAvailable) - FlatButton( + TextButton( child: Text(localization.viewChanges.toUpperCase()), onPressed: () => launch(kGitHubDiffUrl.replaceFirst( 'VERSION', account.currentVersion)), ), if (!account.isDocker) - FlatButton( + TextButton( child: Text(localization.updateNow.toUpperCase()), onPressed: () { updateApp(context); }, ), ] else if (updateState == UpdateState.done) - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () { Navigator.of(context).pop(); diff --git a/lib/ui/task/edit/task_edit_times.dart b/lib/ui/task/edit/task_edit_times.dart index 63e176c5f..40ac553fb 100644 --- a/lib/ui/task/edit/task_edit_times.dart +++ b/lib/ui/task/edit/task_edit_times.dart @@ -181,14 +181,14 @@ class TimeEditDetailsState extends State { ), ), actions: [ - FlatButton( + TextButton( child: Text(localization.remove.toUpperCase()), onPressed: () { widget.viewModel.onRemoveTaskTimePressed(widget.index); Navigator.of(context).pop(); }, ), - FlatButton( + TextButton( child: Text(localization.done.toUpperCase()), onPressed: () { widget.viewModel.onDoneTaskTimePressed(); diff --git a/lib/ui/vendor/edit/vendor_edit_contacts.dart b/lib/ui/vendor/edit/vendor_edit_contacts.dart index 586fe951b..3d2e57d00 100644 --- a/lib/ui/vendor/edit/vendor_edit_contacts.dart +++ b/lib/ui/vendor/edit/vendor_edit_contacts.dart @@ -285,7 +285,7 @@ class VendorContactEditDetailsState extends State { ? AlertDialog( content: SingleChildScrollView(child: column), actions: [ - FlatButton( + TextButton( child: Text(localization.remove.toUpperCase()), onPressed: () => confirmCallback( context: context, @@ -294,7 +294,7 @@ class VendorContactEditDetailsState extends State { Navigator.pop(context); }), ), - FlatButton( + TextButton( child: Text(localization.done.toUpperCase()), onPressed: () { viewModel.onDoneContactPressed(); diff --git a/lib/utils/dialogs.dart b/lib/utils/dialogs.dart index e10d690bb..764ae840b 100644 --- a/lib/utils/dialogs.dart +++ b/lib/utils/dialogs.dart @@ -27,7 +27,7 @@ void showErrorDialog({ void showMessageDialog({ @required BuildContext context, @required String message, - List secondaryActions, + List secondaryActions, }) { showDialog( context: context, @@ -79,12 +79,12 @@ void confirmCallback({ ? null : Text(content), actions: [ - FlatButton( + TextButton( child: Text(localization.cancel.toUpperCase()), onPressed: () { Navigator.pop(context); }), - FlatButton( + TextButton( child: Text(localization.ok.toUpperCase()), onPressed: () { if (typeToConfirm == null || @@ -192,7 +192,7 @@ void fieldCallback({ String field, Function(String) callback, int maxLength, - List secondaryActions, + List secondaryActions, }) { showDialog( context: context, @@ -222,7 +222,7 @@ class FieldConfirmation extends StatefulWidget { final String title; final String field; final int maxLength; - final List secondaryActions; + final List secondaryActions; @override _FieldConfirmationState createState() => _FieldConfirmationState(); @@ -335,7 +335,7 @@ void cloneToDialog({ ], ), actions: [ - FlatButton( + TextButton( child: Text(localization.close.toUpperCase()), onPressed: () => Navigator.of(context).pop(), ) diff --git a/samples/form_keys.dart b/samples/form_keys.dart index 834f28496..c21bcc3b3 100644 --- a/samples/form_keys.dart +++ b/samples/form_keys.dart @@ -23,7 +23,8 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State with SingleTickerProviderStateMixin { - static final GlobalKey _formKey = GlobalKey(debugLabel: '_appState'); + static final GlobalKey _formKey = + GlobalKey(debugLabel: '_appState'); static final GlobalKey _clientKey = GlobalKey(); @@ -234,7 +235,7 @@ class ContactsPageState extends State } } -// Displays an individual contact +// Displays an individual contact class ContactForm extends StatefulWidget { const ContactForm({ Key key, @@ -273,7 +274,7 @@ class ContactFormState extends State { children: [ Padding( padding: const EdgeInsets.only(top: 12.0), - child: FlatButton( + child: TextButton( onPressed: () => widget.onRemovePressed(widget.key), child: Text( 'Delete', diff --git a/samples/form_redux.dart b/samples/form_redux.dart index 17ac3b4c7..1b3eb3d14 100644 --- a/samples/form_redux.dart +++ b/samples/form_redux.dart @@ -119,7 +119,8 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State with SingleTickerProviderStateMixin { - static final GlobalKey _formKey = GlobalKey(debugLabel: '_appState'); + static final GlobalKey _formKey = + GlobalKey(debugLabel: '_appState'); TabController _controller; @@ -327,7 +328,7 @@ class _ContactFormState extends State { children: [ Padding( padding: const EdgeInsets.only(top: 12.0), - child: FlatButton( + child: TextButton( onPressed: () => store.dispatch(DeleteContact(widget.index)), child: Text( 'Delete',