mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
mobile: Add about screen
This commit is contained in:
parent
0ccebb2217
commit
a0310883fb
4 changed files with 81 additions and 0 deletions
25
mobile/assets/about.md
Normal file
25
mobile/assets/about.md
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Introduction
|
||||||
|
|
||||||
|
Musicus is a classical music player and organizer.
|
||||||
|
|
||||||
|
# Contact
|
||||||
|
|
||||||
|
Please contact me [via e-mail](mailto:johrpan@gmail.com?subject=Musicus), if
|
||||||
|
you have any questions or need help. I'm also open to ideas for the future of
|
||||||
|
Musicus! Musicus is free and open source software. You can study the source
|
||||||
|
code and contribute to it on [GitHub](https://github.com/johrpan/musicus).
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
© 2019–2020 Elias Projahn
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify it under
|
||||||
|
the terms of the GNU Affero General Public License as published by the Free
|
||||||
|
Software Foundation, either version 3 of the License, or (at your option) any
|
||||||
|
later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. See the
|
||||||
|
[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html)
|
||||||
|
for more details.
|
||||||
40
mobile/lib/screens/about.dart
Normal file
40
mobile/lib/screens/about.dart
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart' as url;
|
||||||
|
|
||||||
|
class AboutScreen extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
final textTheme = theme.textTheme;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text('About'),
|
||||||
|
),
|
||||||
|
body: FutureBuilder<String>(
|
||||||
|
future: rootBundle.loadString('assets/about.md'),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
if (snapshot.hasData) {
|
||||||
|
return Markdown(
|
||||||
|
data: snapshot.data,
|
||||||
|
styleSheet: MarkdownStyleSheet(
|
||||||
|
h1: textTheme.headline6.copyWith(
|
||||||
|
height: 2.0,
|
||||||
|
),
|
||||||
|
a: textTheme.bodyText1.copyWith(
|
||||||
|
color: theme.accentColor,
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTapLink: (link) => url.launch(link),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ import 'package:musicus_database/musicus_database.dart';
|
||||||
|
|
||||||
import '../icons.dart';
|
import '../icons.dart';
|
||||||
|
|
||||||
|
import 'about.dart';
|
||||||
import 'person.dart';
|
import 'person.dart';
|
||||||
import 'settings.dart';
|
import 'settings.dart';
|
||||||
|
|
||||||
|
|
@ -48,6 +49,10 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
value: 2,
|
value: 2,
|
||||||
child: Text('Settings'),
|
child: Text('Settings'),
|
||||||
),
|
),
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 3,
|
||||||
|
child: Text('About'),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
onSelected: (selected) {
|
onSelected: (selected) {
|
||||||
if (selected == 1) {
|
if (selected == 1) {
|
||||||
|
|
@ -65,6 +70,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
builder: (context) => SettingsScreen(),
|
builder: (context) => SettingsScreen(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
} else if (selected == 3) {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => AboutScreen(),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ dependencies:
|
||||||
audio_service:
|
audio_service:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_markdown:
|
||||||
meta:
|
meta:
|
||||||
moor:
|
moor:
|
||||||
moor_ffi:
|
moor_ffi:
|
||||||
|
|
@ -27,9 +28,12 @@ dependencies:
|
||||||
path_provider:
|
path_provider:
|
||||||
rxdart:
|
rxdart:
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
|
url_launcher:
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
assets:
|
||||||
|
- assets/about.md
|
||||||
fonts:
|
fonts:
|
||||||
- family: Libertinus Sans
|
- family: Libertinus Sans
|
||||||
fonts:
|
fonts:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue