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>(
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<String>(
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),
),
],
);

View file

@ -22,17 +22,18 @@ mixin PermissionAwareMixin {
final confirmed = await showDialog<bool>(
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),
),
],
);

View file

@ -40,16 +40,17 @@ class SelectionActionDelegate with PermissionAwareMixin {
final confirmed = await showDialog<bool>(
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),
),
],
);