81 lines
3.0 KiB
Dart
81 lines
3.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:plezy/widgets/app_icon.dart';
|
|
import 'package:material_symbols_icons/symbols.dart';
|
|
import 'package:package_info_plus/package_info_plus.dart';
|
|
import '../../widgets/focused_scroll_scaffold.dart';
|
|
import '../../widgets/focusable_list_tile.dart';
|
|
import '../../widgets/settings_section.dart';
|
|
import '../../i18n/strings.g.dart';
|
|
import '../../theme/mono_tokens.dart';
|
|
import 'licenses_screen.dart';
|
|
|
|
class AboutScreen extends StatelessWidget {
|
|
const AboutScreen({super.key});
|
|
|
|
static final Future<PackageInfo> _packageInfoFuture = PackageInfo.fromPlatform();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final appName = t.app.title;
|
|
|
|
return FutureBuilder<PackageInfo>(
|
|
future: _packageInfoFuture,
|
|
builder: (context, snapshot) {
|
|
final appVersion = snapshot.data?.version ?? '';
|
|
return FocusedScrollScaffold(
|
|
title: Text(t.about.title),
|
|
slivers: [
|
|
SliverPadding(
|
|
padding: const EdgeInsets.all(16),
|
|
sliver: SliverList(
|
|
delegate: SliverChildListDelegate([
|
|
Center(
|
|
child: Column(
|
|
children: [
|
|
const SizedBox(height: 24),
|
|
Image.asset('assets/plezy.png', width: 80, height: 80),
|
|
const SizedBox(height: 16),
|
|
Text(appName, style: Theme.of(context).textTheme.headlineMedium?.copyWith(fontWeight: .bold)),
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
t.about.versionLabel(version: appVersion),
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: tokens(context).textMuted),
|
|
),
|
|
const SizedBox(height: 24),
|
|
Text(
|
|
t.about.appDescription,
|
|
style: Theme.of(context).textTheme.bodyLarge,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
|
|
const SizedBox(height: 40),
|
|
|
|
SettingsGroup(
|
|
margin: EdgeInsets.zero,
|
|
children: [
|
|
FocusableListTile(
|
|
leading: const AppIcon(Symbols.description_rounded, fill: 1),
|
|
title: Text(t.about.openSourceLicenses),
|
|
subtitle: Text(t.about.viewLicensesDescription),
|
|
trailing: const AppIcon(Symbols.chevron_right_rounded, fill: 1),
|
|
onTap: () {
|
|
Navigator.push(context, MaterialPageRoute(builder: (context) => const LicensesScreen()));
|
|
},
|
|
),
|
|
],
|
|
),
|
|
|
|
const SizedBox(height: 24),
|
|
]),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|