From 85517012aeed12403fb2001e84224258198d113e Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Fri, 8 May 2020 09:56:42 +0900 Subject: [PATCH] use theme button text style --- .../common/action_delegates/entry_action_delegate.dart | 10 ++++++---- .../common/action_delegates/permission_aware.dart | 5 +++-- .../action_delegates/selection_action_delegate.dart | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/widgets/common/action_delegates/entry_action_delegate.dart b/lib/widgets/common/action_delegates/entry_action_delegate.dart index d39d04855..203dc24ef 100644 --- a/lib/widgets/common/action_delegates/entry_action_delegate.dart +++ b/lib/widgets/common/action_delegates/entry_action_delegate.dart @@ -133,16 +133,17 @@ class EntryActionDelegate with PermissionAwareMixin { final confirmed = await showDialog( context: context, builder: (BuildContext context) { + final buttonStyle = Theme.of(context).textTheme.button; return AlertDialog( content: const Text('Are you sure?'), actions: [ FlatButton( onPressed: () => Navigator.pop(context), - child: const Text('CANCEL'), + child: Text('Cancel', style: buttonStyle), ), FlatButton( onPressed: () => Navigator.pop(context, true), - child: const Text('DELETE'), + child: Text('Delete', style: buttonStyle), ), ], ); @@ -172,6 +173,7 @@ class EntryActionDelegate with PermissionAwareMixin { final newName = await showDialog( context: context, builder: (BuildContext context) { + final buttonStyle = Theme.of(context).textTheme.button; return AlertDialog( content: TextField( controller: controller, @@ -180,11 +182,11 @@ class EntryActionDelegate with PermissionAwareMixin { actions: [ FlatButton( onPressed: () => Navigator.pop(context), - child: const Text('CANCEL'), + child: Text('Cancel', style: buttonStyle), ), FlatButton( onPressed: () => Navigator.pop(context, controller.text), - child: const Text('APPLY'), + child: Text('Apply', style: buttonStyle), ), ], ); diff --git a/lib/widgets/common/action_delegates/permission_aware.dart b/lib/widgets/common/action_delegates/permission_aware.dart index d04d6f15f..3299aad46 100644 --- a/lib/widgets/common/action_delegates/permission_aware.dart +++ b/lib/widgets/common/action_delegates/permission_aware.dart @@ -22,17 +22,18 @@ mixin PermissionAwareMixin { final confirmed = await showDialog( context: context, builder: (BuildContext context) { + final buttonStyle = Theme.of(context).textTheme.button; return AlertDialog( title: const Text('Storage Volume Access'), content: Text('Please select the root directory of “${volume.description}” in the next screen, so that this app can access it and complete your request.'), actions: [ FlatButton( onPressed: () => Navigator.pop(context), - child: const Text('CANCEL'), + child: Text('Cancel', style: buttonStyle), ), FlatButton( onPressed: () => Navigator.pop(context, true), - child: const Text('OK'), + child: Text('OK', style: buttonStyle), ), ], ); diff --git a/lib/widgets/common/action_delegates/selection_action_delegate.dart b/lib/widgets/common/action_delegates/selection_action_delegate.dart index d2936c189..02d64ae6c 100644 --- a/lib/widgets/common/action_delegates/selection_action_delegate.dart +++ b/lib/widgets/common/action_delegates/selection_action_delegate.dart @@ -40,16 +40,17 @@ class SelectionActionDelegate with PermissionAwareMixin { final confirmed = await showDialog( context: context, builder: (BuildContext context) { + final buttonStyle = Theme.of(context).textTheme.button; return AlertDialog( content: Text('Are you sure you want to delete ${Intl.plural(count, one: 'this item', other: 'these ${count} items')}?'), actions: [ FlatButton( onPressed: () => Navigator.pop(context), - child: const Text('CANCEL'), + child: Text('Cancel', style: buttonStyle), ), FlatButton( onPressed: () => Navigator.pop(context, true), - child: const Text('DELETE'), + child: Text('Delete', style: buttonStyle), ), ], );