Move changelog to new page

This commit is contained in:
Filip Krawczyk 2021-11-04 22:47:26 +01:00
parent e06d35ecc3
commit 59f0a0233c
1 changed files with 28 additions and 9 deletions

View File

@ -7,7 +7,7 @@ import '../gen/assets.gen.dart';
import '../hooks/memo_future.dart';
import '../pages/log_console_page/log_console_page.dart';
import '../url_launcher.dart';
import 'bottom_modal.dart';
import 'bottom_safe.dart';
/// Title that opens a dialog with information about Lemmur.
/// Licenses, changelog, version etc.
@ -35,14 +35,10 @@ class AboutTile extends HookWidget {
icon: const Icon(Icons.info),
aboutBoxChildren: [
TextButton.icon(
icon: const Icon(Icons.subject),
label: const Text('changelog'),
onPressed: () => showBottomModal(
context: context,
padding: const EdgeInsets.all(8),
builder: (_) => MarkdownBody(data: changelog),
),
),
icon: const Icon(Icons.subject),
label: const Text('changelog'),
onPressed: () =>
Navigator.of(context).push(ChangelogPage.route(changelog))),
TextButton.icon(
icon: const Icon(Icons.code),
label: const Text('source code'),
@ -90,3 +86,26 @@ class AboutTile extends HookWidget {
);
}
}
class ChangelogPage extends StatelessWidget {
final String changelog;
const ChangelogPage(this.changelog, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Changelog')),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
MarkdownBody(data: changelog),
const BottomSafe(),
],
));
}
static Route route(String changelog) => MaterialPageRoute(
builder: (context) => ChangelogPage(changelog),
);
}