use new Material buttons

This commit is contained in:
Thibault Deckers 2020-10-12 11:56:42 +09:00
parent c163e21910
commit 0110b82c52
14 changed files with 47 additions and 32 deletions

View file

@ -65,6 +65,21 @@ class _AvesAppState extends State<AvesApp> {
),
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
primary: accentColor,
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
primary: accentColor,
),
),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
primary: Colors.white,
),
),
);
Widget get firstPage => settings.hasAcceptedTerms ? HomePage() : WelcomePage();

View file

@ -48,14 +48,14 @@ class _AddShortcutDialogState extends State<AddShortcutDialog> {
onSubmitted: (_) => _submit(context),
),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
ValueListenableBuilder<bool>(
valueListenable: _isValidNotifier,
builder: (context, isValid, child) {
return FlatButton(
return TextButton(
onPressed: isValid ? () => _submit(context) : null,
child: Text('Add'.toUpperCase()),
);

View file

@ -92,14 +92,14 @@ class _CreateAlbumDialogState extends State<CreateAlbumDialog> {
),
],
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
ValueListenableBuilder<bool>(
valueListenable: _isValidNotifier,
builder: (context, isValid, child) {
return FlatButton(
return TextButton(
onPressed: isValid ? () => _submit(context) : null,
child: Text('Create'.toUpperCase()),
);

View file

@ -127,11 +127,11 @@ class EntryActionDelegate with FeedbackMixin, PermissionAwareMixin {
return AvesDialog(
content: Text('Are you sure?'),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, true),
child: Text('Delete'.toUpperCase()),
),

View file

@ -28,11 +28,11 @@ mixin PermissionAwareMixin {
title: 'Storage Volume Access',
content: Text('Please select the $dirDisplayName directory of “$volumeDescription” in the next screen, so that this app can access it and complete your request.'),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, true),
child: Text('OK'.toUpperCase()),
),

View file

@ -54,14 +54,14 @@ class _RenameAlbumDialogState extends State<RenameAlbumDialog> {
);
}),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
ValueListenableBuilder<bool>(
valueListenable: _isValidNotifier,
builder: (context, isValid, child) {
return FlatButton(
return TextButton(
onPressed: isValid ? () => _submit(context) : null,
child: Text('Apply'.toUpperCase()),
);

View file

@ -48,14 +48,14 @@ class _RenameEntryDialogState extends State<RenameEntryDialog> {
onSubmitted: (_) => _submit(context),
),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
ValueListenableBuilder<bool>(
valueListenable: _isValidNotifier,
builder: (context, isValid, child) {
return FlatButton(
return TextButton(
onPressed: isValid ? () => _submit(context) : null,
child: Text('Apply'.toUpperCase()),
);

View file

@ -148,11 +148,11 @@ class SelectionActionDelegate with FeedbackMixin, PermissionAwareMixin {
return AvesDialog(
content: Text('Are you sure you want to delete ${Intl.plural(count, one: 'this item', other: 'these $count items')}?'),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, true),
child: Text('Delete'.toUpperCase()),
),

View file

@ -38,7 +38,7 @@ class _AvesSelectionDialogState<T> extends State<AvesSelectionDialog> {
title: widget.title,
scrollableContent: widget.options.entries.map((kv) => _buildRadioListTile(kv.key, kv.value)).toList(),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),

View file

@ -103,7 +103,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('Crashlytics'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: FirebaseCrashlytics.instance.crash,
child: Text('Crash'),
),
@ -123,7 +123,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('Image cache:\n\t${imageCache.currentSize}/${imageCache.maximumSize} items\n\t${formatFilesize(imageCache.currentSizeBytes)}/${formatFilesize(imageCache.maximumSizeBytes)}'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () {
imageCache.clear();
setState(() {});
@ -138,7 +138,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('SVG cache: ${PictureProvider.cacheCount} items'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () {
PictureProvider.clearCache();
setState(() {});
@ -153,7 +153,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('Glide disk cache: ?'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: ImageFileService.clearSizedThumbnailDiskCache,
child: Text('Clear'),
),
@ -171,7 +171,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('DB file size: ${formatFilesize(snapshot.data)}'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () => metadataDb.reset().then((_) => _startDbReport()),
child: Text('Reset'),
),
@ -190,7 +190,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('DB entry rows: ${snapshot.data.length}'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () => metadataDb.clearEntries().then((_) => _startDbReport()),
child: Text('Clear'),
),
@ -209,7 +209,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('DB date rows: ${snapshot.data.length}'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () => metadataDb.clearDates().then((_) => _startDbReport()),
child: Text('Clear'),
),
@ -228,7 +228,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('DB metadata rows: ${snapshot.data.length}'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () => metadataDb.clearMetadataEntries().then((_) => _startDbReport()),
child: Text('Clear'),
),
@ -247,7 +247,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('DB address rows: ${snapshot.data.length}'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () => metadataDb.clearAddresses().then((_) => _startDbReport()),
child: Text('Clear'),
),
@ -266,7 +266,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('DB favourite rows: ${snapshot.data.length} (${favourites.count} in memory)'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () => favourites.clear().then((_) => _startDbReport()),
child: Text('Clear'),
),
@ -288,7 +288,7 @@ class DebugPageState extends State<DebugPage> {
child: Text('Settings'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () => settings.reset().then((_) => setState(() {})),
child: Text('Reset'),
),

View file

@ -65,11 +65,11 @@ class AlbumChipActionDelegate extends ChipActionDelegate with FeedbackMixin, Per
return AvesDialog(
content: Text('Are you sure you want to delete this album and its ${Intl.plural(count, one: 'item', other: '$count items')}?'),
actions: [
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context),
child: Text('Cancel'.toUpperCase()),
),
FlatButton(
TextButton(
onPressed: () => Navigator.pop(context, true),
child: Text('Delete'.toUpperCase()),
),

View file

@ -176,7 +176,7 @@ class _FullscreenDebugPageState extends State<FullscreenDebugPage> {
child: Text('DB'),
),
SizedBox(width: 8),
RaisedButton(
ElevatedButton(
onPressed: () async {
await metadataDb.removeIds([entry.contentId]);
_loadDatabase();

View file

@ -46,13 +46,13 @@ class _GrantedDirectoriesState extends State<GrantedDirectories> {
children: [
Expanded(child: Text(path, style: textTheme.caption)),
SizedBox(width: 8),
OutlineButton(
OutlinedButton(
onPressed: () async {
await AndroidFileService.revokeDirectoryAccess(path);
_load();
setState(() {});
},
child: Text('Revoke'),
child: Text('Revoke'.toUpperCase()),
),
],
)),

View file

@ -110,7 +110,7 @@ class _WelcomePageState extends State<WelcomePage> {
],
);
final button = RaisedButton(
final button = ElevatedButton(
key: Key('continue-button'),
child: Text('Continue'),
onPressed: _hasAcceptedTerms