Skip to content

Commit

Permalink
Add contributors and icon to about dialog (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier authored Aug 30, 2022
1 parent 78966eb commit 667cbae
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/contributors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- [Frederik Feichtmeier](https://github.com/Feichtmeier)
- [Paul Kepinski](https://github.com/Jupi007)
- [Mads Rosendahl](https://github.com/madsrh)
- [JP Nurmi](https://github.com/jpnurmi)
- [Olivier Tilloy](https://github.com/oSoMoN)
- [Elio Qoshi](https://github.com/elioqoshi)
Binary file added assets/software.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions lib/store_app/settings/settings_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:provider/provider.dart';
import 'package:software/l10n/l10n.dart';
import 'package:software/store_app/settings/settings_model.dart';
Expand Down Expand Up @@ -28,6 +29,11 @@ class _SettingsPageState extends State<SettingsPage> {
super.initState();
}

Future<String> loadAsset(BuildContext context) async {
return await DefaultAssetBundle.of(context)
.loadString('assets/contributors.md');
}

@override
Widget build(BuildContext context) {
final model = context.watch<SettingsModel>();
Expand All @@ -44,6 +50,31 @@ class _SettingsPageState extends State<SettingsPage> {
actionWidget: TextButton(
onPressed: () {
showAboutDialog(
applicationVersion: model.version,
applicationIcon: Image.asset(
'assets/software.png',
width: 60,
filterQuality: FilterQuality.medium,
),
children: [
SizedBox(
height: 300,
width: 300,
child: FutureBuilder<String>(
future: loadAsset(context),
builder: (context, snapshot) {
if (snapshot.hasData) {
return Markdown(
shrinkWrap: true,
data: 'is made by:\n ${snapshot.data!}',
);
} else {
return const SizedBox();
}
},
),
)
],
context: context,
useRootNavigator: false,
);
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ dev_dependencies:
flutter:
uses-material-design: true
generate: true
assets:
- assets/contributors.md
- assets/software.png

0 comments on commit 667cbae

Please sign in to comment.