mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-09 07:28:14 -07:00
feature: Improved about page (#75)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
8dc18c8a3d
commit
62143581ac
8 changed files with 273 additions and 111 deletions
116
lib/screens/settings/about_settings_page.dart
Normal file
116
lib/screens/settings/about_settings_page.dart
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:ficonsax/ficonsax.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
|
||||
import 'package:fladder/screens/settings/settings_scaffold.dart';
|
||||
import 'package:fladder/screens/shared/fladder_icon.dart';
|
||||
import 'package:fladder/screens/shared/media/external_urls.dart';
|
||||
import 'package:fladder/util/application_info.dart';
|
||||
import 'package:fladder/util/list_padding.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
|
||||
class _Socials {
|
||||
final String label;
|
||||
final String url;
|
||||
final IconData icon;
|
||||
|
||||
const _Socials(this.label, this.url, this.icon);
|
||||
}
|
||||
|
||||
const socials = [
|
||||
_Socials(
|
||||
'Github',
|
||||
'https://github.com/DonutWare/Fladder',
|
||||
FontAwesomeIcons.githubAlt,
|
||||
),
|
||||
_Socials(
|
||||
'Weblate',
|
||||
'https://hosted.weblate.org/projects/fladder/',
|
||||
IconsaxOutline.global,
|
||||
),
|
||||
];
|
||||
|
||||
@RoutePage()
|
||||
class AboutSettingsPage extends ConsumerWidget {
|
||||
const AboutSettingsPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final applicationInfo = ref.watch(applicationInfoProvider);
|
||||
return Card(
|
||||
child: SettingsScaffold(
|
||||
label: "",
|
||||
items: [
|
||||
Wrap(
|
||||
runAlignment: WrapAlignment.center,
|
||||
alignment: WrapAlignment.center,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
runSpacing: 24,
|
||||
spacing: 24,
|
||||
children: [
|
||||
const FladderIcon(size: 85),
|
||||
Text(
|
||||
"Fladder",
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.displayLarge?.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(context.localized.aboutVersion(applicationInfo.versionAndPlatform)),
|
||||
Text(context.localized.aboutBuild(applicationInfo.buildNumber)),
|
||||
const SizedBox(height: 16),
|
||||
Text(context.localized.aboutCreatedBy),
|
||||
],
|
||||
),
|
||||
const Divider(),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
context.localized.aboutSocials,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: socials
|
||||
.map(
|
||||
(e) => IconButton.filledTonal(
|
||||
onPressed: () => launchUrl(context, e.url),
|
||||
icon: Column(
|
||||
children: [
|
||||
Icon(e.icon),
|
||||
Text(e.label),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList()
|
||||
.addInBetween(const SizedBox(width: 16)),
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
FilledButton.tonal(
|
||||
onPressed: () => showLicensePage(
|
||||
context: context,
|
||||
applicationIcon: const FladderIcon(size: 85),
|
||||
applicationVersion: applicationInfo.versionPlatformBuild,
|
||||
applicationLegalese: "DonutWare",
|
||||
),
|
||||
child: Text(context.localized.aboutLicenses),
|
||||
)
|
||||
],
|
||||
),
|
||||
].addInBetween(const SizedBox(height: 16)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,7 +12,6 @@ import 'package:fladder/screens/settings/settings_list_tile.dart';
|
|||
import 'package:fladder/screens/settings/settings_scaffold.dart';
|
||||
import 'package:fladder/screens/shared/fladder_icon.dart';
|
||||
import 'package:fladder/util/adaptive_layout.dart';
|
||||
import 'package:fladder/util/application_info.dart';
|
||||
import 'package:fladder/util/localization_helper.dart';
|
||||
import 'package:fladder/util/router_extension.dart';
|
||||
import 'package:fladder/util/theme_extensions.dart';
|
||||
|
|
@ -136,6 +135,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
SettingsListTile(
|
||||
label: Text(context.localized.about),
|
||||
subLabel: const Text("Fladder"),
|
||||
selected: containsRoute(const AboutSettingsRoute()),
|
||||
suffix: Opacity(
|
||||
opacity: 1,
|
||||
child: FladderIconOutlined(
|
||||
|
|
@ -143,12 +143,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||
color: context.colors.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
onTap: () => showAboutDialog(
|
||||
context: context,
|
||||
applicationIcon: const FladderIcon(size: 85),
|
||||
applicationVersion: ref.watch(applicationInfoProvider).versionAndPlatform,
|
||||
applicationLegalese: "Donut Factory",
|
||||
),
|
||||
onTap: () => navigateTo(const AboutSettingsRoute()),
|
||||
),
|
||||
],
|
||||
floatingActionButton: Padding(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue