use theme button text style

This commit is contained in:
Thibault Deckers 2020-05-08 09:56:42 +09:00
parent 8b06e6c86c
commit 85517012ae
3 changed files with 12 additions and 8 deletions

View file

@ -133,16 +133,17 @@ class EntryActionDelegate with PermissionAwareMixin {
final confirmed = await showDialog<bool>( final confirmed = await showDialog<bool>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
final buttonStyle = Theme.of(context).textTheme.button;
return AlertDialog( return AlertDialog(
content: const Text('Are you sure?'), content: const Text('Are you sure?'),
actions: [ actions: [
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
child: const Text('CANCEL'), child: Text('Cancel', style: buttonStyle),
), ),
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context, true), 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<String>( final newName = await showDialog<String>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
final buttonStyle = Theme.of(context).textTheme.button;
return AlertDialog( return AlertDialog(
content: TextField( content: TextField(
controller: controller, controller: controller,
@ -180,11 +182,11 @@ class EntryActionDelegate with PermissionAwareMixin {
actions: [ actions: [
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
child: const Text('CANCEL'), child: Text('Cancel', style: buttonStyle),
), ),
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context, controller.text), onPressed: () => Navigator.pop(context, controller.text),
child: const Text('APPLY'), child: Text('Apply', style: buttonStyle),
), ),
], ],
); );

View file

@ -22,17 +22,18 @@ mixin PermissionAwareMixin {
final confirmed = await showDialog<bool>( final confirmed = await showDialog<bool>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
final buttonStyle = Theme.of(context).textTheme.button;
return AlertDialog( return AlertDialog(
title: const Text('Storage Volume Access'), 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.'), 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: [ actions: [
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
child: const Text('CANCEL'), child: Text('Cancel', style: buttonStyle),
), ),
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context, true), onPressed: () => Navigator.pop(context, true),
child: const Text('OK'), child: Text('OK', style: buttonStyle),
), ),
], ],
); );

View file

@ -40,16 +40,17 @@ class SelectionActionDelegate with PermissionAwareMixin {
final confirmed = await showDialog<bool>( final confirmed = await showDialog<bool>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
final buttonStyle = Theme.of(context).textTheme.button;
return AlertDialog( return AlertDialog(
content: Text('Are you sure you want to delete ${Intl.plural(count, one: 'this item', other: 'these ${count} items')}?'), content: Text('Are you sure you want to delete ${Intl.plural(count, one: 'this item', other: 'these ${count} items')}?'),
actions: [ actions: [
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
child: const Text('CANCEL'), child: Text('Cancel', style: buttonStyle),
), ),
FlatButton( FlatButton(
onPressed: () => Navigator.pop(context, true), onPressed: () => Navigator.pop(context, true),
child: const Text('DELETE'), child: Text('Delete', style: buttonStyle),
), ),
], ],
); );