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 '../hooks/memo_future.dart';
import '../pages/log_console_page/log_console_page.dart'; import '../pages/log_console_page/log_console_page.dart';
import '../url_launcher.dart'; import '../url_launcher.dart';
import 'bottom_modal.dart'; import 'bottom_safe.dart';
/// Title that opens a dialog with information about Lemmur. /// Title that opens a dialog with information about Lemmur.
/// Licenses, changelog, version etc. /// Licenses, changelog, version etc.
@ -37,12 +37,8 @@ class AboutTile extends HookWidget {
TextButton.icon( TextButton.icon(
icon: const Icon(Icons.subject), icon: const Icon(Icons.subject),
label: const Text('changelog'), label: const Text('changelog'),
onPressed: () => showBottomModal( onPressed: () =>
context: context, Navigator.of(context).push(ChangelogPage.route(changelog))),
padding: const EdgeInsets.all(8),
builder: (_) => MarkdownBody(data: changelog),
),
),
TextButton.icon( TextButton.icon(
icon: const Icon(Icons.code), icon: const Icon(Icons.code),
label: const Text('source 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),
);
}