about/settings button style consistency
This commit is contained in:
parent
3196efcb04
commit
ff1af89ce1
5 changed files with 45 additions and 16 deletions
|
@ -425,7 +425,7 @@
|
||||||
"@aboutLicensesFlutterPackages": {},
|
"@aboutLicensesFlutterPackages": {},
|
||||||
"aboutLicensesDartPackages": "Dart Packages",
|
"aboutLicensesDartPackages": "Dart Packages",
|
||||||
"@aboutLicensesDartPackages": {},
|
"@aboutLicensesDartPackages": {},
|
||||||
"aboutLicensesShowAllButtonLabel": "SHOW ALL LICENSES",
|
"aboutLicensesShowAllButtonLabel": "Show All Licenses",
|
||||||
"@aboutLicensesShowAllButtonLabel": {},
|
"@aboutLicensesShowAllButtonLabel": {},
|
||||||
|
|
||||||
"collectionPageTitle": "Collection",
|
"collectionPageTitle": "Collection",
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/widgets/common/action_mixins/feedback.dart';
|
import 'package:aves/widgets/common/action_mixins/feedback.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/aves_filter_chip.dart';
|
import 'package:aves/widgets/common/identity/aves_filter_chip.dart';
|
||||||
|
import 'package:aves/widgets/common/identity/buttons.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
@ -109,13 +110,9 @@ class _BugReportState extends State<BugReport> with FeedbackMixin {
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(child: Text(text)),
|
Expanded(child: Text(text)),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
OutlinedButton(
|
AvesOutlinedButton(
|
||||||
|
label: buttonText,
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
style: ButtonStyle(
|
|
||||||
side: MaterialStateProperty.all<BorderSide>(BorderSide(color: Theme.of(context).colorScheme.secondary)),
|
|
||||||
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
|
|
||||||
),
|
|
||||||
child: Text(buttonText),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:aves/utils/constants.dart';
|
||||||
import 'package:aves/widgets/common/basic/link_chip.dart';
|
import 'package:aves/widgets/common/basic/link_chip.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
|
import 'package:aves/widgets/common/identity/aves_expansion_tile.dart';
|
||||||
|
import 'package:aves/widgets/common/identity/buttons.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
@ -69,7 +70,8 @@ class _LicensesState extends State<Licenses> {
|
||||||
children: _dartPackages.map((package) => LicenseRow(package: package)).toList(),
|
children: _dartPackages.map((package) => LicenseRow(package: package)).toList(),
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: TextButton(
|
child: AvesOutlinedButton(
|
||||||
|
label: context.l10n.aboutLicensesShowAllButtonLabel,
|
||||||
onPressed: () => Navigator.push(
|
onPressed: () => Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
|
@ -82,7 +84,6 @@ class _LicensesState extends State<Licenses> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Text(context.l10n.aboutLicensesShowAllButtonLabel),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
34
lib/widgets/common/identity/buttons.dart
Normal file
34
lib/widgets/common/identity/buttons.dart
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AvesOutlinedButton extends StatelessWidget {
|
||||||
|
final Widget? icon;
|
||||||
|
final String label;
|
||||||
|
final VoidCallback? onPressed;
|
||||||
|
|
||||||
|
const AvesOutlinedButton({
|
||||||
|
Key? key,
|
||||||
|
this.icon,
|
||||||
|
required this.label,
|
||||||
|
required this.onPressed,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final style = ButtonStyle(
|
||||||
|
side: MaterialStateProperty.all<BorderSide>(BorderSide(color: Theme.of(context).colorScheme.secondary)),
|
||||||
|
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
|
||||||
|
);
|
||||||
|
return icon != null
|
||||||
|
? OutlinedButton.icon(
|
||||||
|
onPressed: onPressed,
|
||||||
|
style: style,
|
||||||
|
icon: icon!,
|
||||||
|
label: Text(label),
|
||||||
|
)
|
||||||
|
: OutlinedButton(
|
||||||
|
onPressed: onPressed,
|
||||||
|
style: style,
|
||||||
|
child: Text(label),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ import 'package:aves/model/filters/album.dart';
|
||||||
import 'package:aves/model/source/collection_source.dart';
|
import 'package:aves/model/source/collection_source.dart';
|
||||||
import 'package:aves/theme/icons.dart';
|
import 'package:aves/theme/icons.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
|
import 'package:aves/widgets/common/identity/buttons.dart';
|
||||||
import 'package:aves/widgets/drawer/tile.dart';
|
import 'package:aves/widgets/drawer/tile.dart';
|
||||||
import 'package:aves/widgets/filter_grids/album_pick.dart';
|
import 'package:aves/widgets/filter_grids/album_pick.dart';
|
||||||
import 'package:aves/widgets/settings/navigation/drawer_editor_banner.dart';
|
import 'package:aves/widgets/settings/navigation/drawer_editor_banner.dart';
|
||||||
|
@ -59,7 +60,9 @@ class _DrawerAlbumTabState extends State<DrawerAlbumTab> {
|
||||||
),
|
),
|
||||||
const Divider(height: 0),
|
const Divider(height: 0),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
OutlinedButton.icon(
|
AvesOutlinedButton(
|
||||||
|
icon: const Icon(AIcons.add),
|
||||||
|
label: context.l10n.settingsNavigationDrawerAddAlbum,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final source = context.read<CollectionSource>();
|
final source = context.read<CollectionSource>();
|
||||||
final album = await Navigator.push(
|
final album = await Navigator.push(
|
||||||
|
@ -76,12 +79,6 @@ class _DrawerAlbumTabState extends State<DrawerAlbumTab> {
|
||||||
widget.items.add(album);
|
widget.items.add(album);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
style: ButtonStyle(
|
|
||||||
side: MaterialStateProperty.all<BorderSide>(BorderSide(color: Theme.of(context).colorScheme.secondary)),
|
|
||||||
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
|
|
||||||
),
|
|
||||||
icon: const Icon(AIcons.add),
|
|
||||||
label: Text(context.l10n.settingsNavigationDrawerAddAlbum),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue