Skip to content

Commit 67ef9c1

Browse files
committed
Update buttons types
1 parent c4d0595 commit 67ef9c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+97
-97
lines changed

lib/redux/credit/credit_actions.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ Future handleCreditAction(
442442
context: context,
443443
message: localization.clientEmailNotSet,
444444
secondaryActions: [
445-
FlatButton(
445+
TextButton(
446446
onPressed: () {
447447
Navigator.of(context).pop();
448448
editEntity(

lib/redux/invoice/invoice_actions.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ void handleInvoiceAction(BuildContext context, List<BaseEntity> invoices,
548548
context: context,
549549
message: localization.clientEmailNotSet,
550550
secondaryActions: [
551-
FlatButton(
551+
TextButton(
552552
onPressed: () {
553553
Navigator.of(context).pop();
554554
editEntity(

lib/redux/quote/quote_actions.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ Future handleQuoteAction(
466466
context: context,
467467
message: localization.clientEmailNotSet,
468468
secondaryActions: [
469-
FlatButton(
469+
TextButton(
470470
onPressed: () {
471471
Navigator.of(context).pop();
472472
editEntity(

lib/ui/app/app_bottom_bar.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ class _AppBottomBarState extends State<AppBottomBar> {
484484
if (!state.prefState.isMenuFloated) Spacer(),
485485
if (!widget.entityType.isSetting && !isList)
486486
if (state.prefState.isDesktop)
487-
FlatButton(
487+
TextButton(
488488
onPressed: _onColumnsPressed,
489489
child: Text(
490490
localization.columns,

lib/ui/app/buttons/action_flat_button.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_redux/flutter_redux.dart';
33
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
44

5-
class ActionFlatButton extends StatelessWidget {
6-
const ActionFlatButton({
5+
class ActionTextButton extends StatelessWidget {
6+
const ActionTextButton({
77
this.onPressed,
88
this.tooltip,
99
this.isSaving = false,
@@ -45,7 +45,7 @@ class ActionFlatButton extends StatelessWidget {
4545
);
4646
}
4747

48-
return FlatButton(
48+
return TextButton(
4949
child: Text(
5050
tooltip,
5151
style: isHeader && onPressed != null

lib/ui/app/buttons/edit_icon_button.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class EditIconButton extends StatelessWidget {
2121
return Container();
2222
}
2323

24-
return FlatButton(
24+
return TextButton(
2525
child: Text(
2626
localization.edit,
2727
style: TextStyle(color: store.state.headerTextColor),

lib/ui/app/change_layout_banner.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class _ChangeLayoutBannerState extends State<ChangeLayoutBanner> {
7171
text: message,
7272
),
7373
),
74-
FlatButton(
74+
TextButton(
7575
child: Text(
7676
localization.dismiss,
7777
style: TextStyle(color: Colors.white),
@@ -80,7 +80,7 @@ class _ChangeLayoutBannerState extends State<ChangeLayoutBanner> {
8080
setState(() => _dismissedChange = true);
8181
},
8282
),
83-
FlatButton(
83+
TextButton(
8484
child: Text(
8585
localization.change,
8686
style: TextStyle(color: Colors.white),

lib/ui/app/dialogs/alert_dialog.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MessageDialog extends StatelessWidget {
1212

1313
final String message;
1414
final String dismissLabel;
15-
final List<FlatButton> secondaryActions;
15+
final List<TextButton> secondaryActions;
1616
final Function onDismiss;
1717
final Function onDiscard;
1818

@@ -42,7 +42,7 @@ class MessageDialog extends StatelessWidget {
4242
if (onDiscard != null)
4343
Padding(
4444
padding: const EdgeInsets.only(right: 10),
45-
child: FlatButton(
45+
child: TextButton(
4646
autofocus: true,
4747
child: Text(
4848
localization.discardChanges.toUpperCase()),
@@ -60,7 +60,7 @@ class MessageDialog extends StatelessWidget {
6060
))
6161
.toList(),
6262
),
63-
FlatButton(
63+
TextButton(
6464
onPressed: () {
6565
Navigator.of(context).pop();
6666
if (onDismiss != null) {

lib/ui/app/dialogs/error_dialog.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ErrorDialog extends StatelessWidget {
2929
content: error != null ? SelectableText(errorStr.toString()) : SizedBox(),
3030
actions: [
3131
if (clearErrorOnDismiss && !Config.DEMO_MODE)
32-
FlatButton(
32+
TextButton(
3333
child: Text(localization.logout.toUpperCase()),
3434
onPressed: () {
3535
confirmCallback(
@@ -38,12 +38,12 @@ class ErrorDialog extends StatelessWidget {
3838
store.dispatch(UserLogout(context));
3939
});
4040
}),
41-
FlatButton(
41+
TextButton(
4242
child: Text(localization.copy.toUpperCase()),
4343
onPressed: () {
4444
Clipboard.setData(ClipboardData(text: errorStr));
4545
}),
46-
FlatButton(
46+
TextButton(
4747
child: Text(localization.dismiss.toUpperCase()),
4848
onPressed: () {
4949
if (clearErrorOnDismiss) {

lib/ui/app/dialogs/health_check_dialog.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ class _HealthCheckDialogState extends State<HealthCheckDialog> {
152152
actions: _response == null
153153
? []
154154
: [
155-
FlatButton(
155+
TextButton(
156156
child: Text(localization.clearCache.toUpperCase()),
157157
onPressed: () => clearCache(),
158158
),
159-
FlatButton(
159+
TextButton(
160160
child: Text(localization.refresh.toUpperCase()),
161161
onPressed: () => runCheck(),
162162
),
163-
FlatButton(
163+
TextButton(
164164
child: Text(localization.close.toUpperCase()),
165165
onPressed: () => Navigator.of(context).pop(),
166166
)

lib/ui/app/dialogs/multiselect_dialog.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class MultiSelectListState extends State<MultiSelectList> {
206206
child: Row(
207207
mainAxisAlignment: MainAxisAlignment.end,
208208
children: <Widget>[
209-
FlatButton(
209+
TextButton(
210210
child: Text(localization.reset.toUpperCase()),
211211
onPressed: () {
212212
setState(
@@ -228,20 +228,20 @@ class MultiSelectListState extends State<MultiSelectList> {
228228
title: Text(localization.editColumns),
229229
content: column,
230230
actions: [
231-
FlatButton(
231+
TextButton(
232232
child: Text(localization.reset.toUpperCase()),
233233
onPressed: () {
234234
setState(() => selected = widget.defaultSelected.toList());
235235
if (widget.liveChanges) {
236236
widget.onSelected(selected);
237237
}
238238
}),
239-
FlatButton(
239+
TextButton(
240240
child: Text(localization.cancel.toUpperCase()),
241241
onPressed: () {
242242
Navigator.pop(context);
243243
}),
244-
FlatButton(
244+
TextButton(
245245
child: Text(localization.save.toUpperCase()),
246246
onPressed: () {
247247
Navigator.pop(context);

lib/ui/app/document_grid.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,14 @@ class DocumentTile extends StatelessWidget {
149149
title: Text(document.name),
150150
actions: [
151151
isFromExpense && onViewExpense != null
152-
? FlatButton(
152+
? TextButton(
153153
child: Text(localization.expense.toUpperCase()),
154154
onPressed: () {
155155
Navigator.of(context).pop();
156156
onViewExpense(document);
157157
},
158158
)
159-
: FlatButton(
159+
: TextButton(
160160
child: Text(localization.delete.toUpperCase()),
161161
onPressed: () {
162162
confirmCallback(
@@ -171,7 +171,7 @@ class DocumentTile extends StatelessWidget {
171171
});
172172
},
173173
),
174-
FlatButton(
174+
TextButton(
175175
child: Text(localization.download.toUpperCase()),
176176
onPressed: () async {
177177
final store = StoreProvider.of<AppState>(context);
@@ -202,7 +202,7 @@ class DocumentTile extends StatelessWidget {
202202
}
203203
},
204204
),
205-
FlatButton(
205+
TextButton(
206206
child: Text(localization.close.toUpperCase()),
207207
onPressed: () {
208208
Navigator.of(context).pop();

lib/ui/app/forms/color_picker.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ class _FormColorPickerState extends State<FormColorPicker> {
9898
),
9999
),
100100
actions: <Widget>[
101-
FlatButton(
101+
TextButton(
102102
child: Text(localization.cancel.toUpperCase()),
103103
onPressed: () => Navigator.of(context).pop(),
104104
),
105-
FlatButton(
105+
TextButton(
106106
child: Text(localization.done.toUpperCase()),
107107
onPressed: () {
108108
_selectColor(_pendingColor);

lib/ui/app/forms/learn_more.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LearnMoreUrl extends StatelessWidget {
2727
SizedBox(
2828
width: 10,
2929
),
30-
FlatButton(
30+
TextButton(
3131
child: Text(localization.learnMore),
3232
onPressed: () async {
3333
if (await canLaunch(url)) {
@@ -63,7 +63,7 @@ class LearnMoreDialog extends StatelessWidget {
6363
SizedBox(
6464
width: 10,
6565
),
66-
FlatButton(
66+
TextButton(
6767
child: Text(label ?? localization.learnMore),
6868
onPressed: () {
6969
showDialog<AlertDialog>(

lib/ui/app/forms/save_cancel_buttons.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SaveCancelButtons extends StatelessWidget {
3434
children: <Widget>[
3535
if (onCancelPressed != null && !isSaving)
3636
Builder(builder: (BuildContext context) {
37-
return FlatButton(
37+
return TextButton(
3838
child: Text(
3939
cancelLabel ?? localization.cancel,
4040
style: isHeader && isEnabled
@@ -48,7 +48,7 @@ class SaveCancelButtons extends StatelessWidget {
4848
}),
4949
SizedBox(width: 10),
5050
Builder(builder: (BuildContext context) {
51-
return ActionFlatButton(
51+
return ActionTextButton(
5252
tooltip: saveLabel ?? localization.save,
5353
isVisible: true,
5454
isSaving: isSaving,

lib/ui/app/list_scaffold.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ListScaffold extends StatelessWidget {
9999
actions: [
100100
...appBarActions ?? <Widget>[],
101101
if (isDesktop(context) && onCancelSettingsSection != null)
102-
FlatButton(
102+
TextButton(
103103
onPressed: () {
104104
store.dispatch(ViewSettings(
105105
navigator: Navigator.of(context),

lib/ui/app/main_screen.dart

+4-6
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ class _EntityFilter extends StatelessWidget {
849849
)
850850
: Row(
851851
children: [
852-
SizedBox(width: 4),
852+
SizedBox(width: 8),
853853
if (!state.prefState.showFilterSidebar)
854854
IconButton(
855855
tooltip: localization.showSidebar,
@@ -860,10 +860,10 @@ class _EntityFilter extends StatelessWidget {
860860
onPressed: () => store.dispatch(
861861
UpdateUserPreferences(showFilterSidebar: true)),
862862
),
863+
SizedBox(width: 4),
863864
ConstrainedBox(
864865
constraints: BoxConstraints(maxWidth: 220),
865-
child: FlatButton(
866-
visualDensity: VisualDensity.compact,
866+
child: TextButton(
867867
child: Text(
868868
EntityPresenter()
869869
.initialize(filterEntity, context)
@@ -887,9 +887,7 @@ class _EntityFilter extends StatelessWidget {
887887
children: <Widget>[
888888
for (int i = 0; i < relatedTypes.length; i++)
889889
DecoratedBox(
890-
child: FlatButton(
891-
minWidth: 0,
892-
visualDensity: VisualDensity.compact,
890+
child: TextButton(
893891
child: Text(
894892
localization
895893
.lookup('${relatedTypes[i].plural}'),

0 commit comments

Comments
 (0)