|
| 1 | +/// about dialog for the app |
| 2 | +/// |
| 3 | +// Time-stamp: <Thursday 2024-06-27 13:38:24 +1000 Graham Williams> |
| 4 | +/// |
| 5 | +/// Copyright (C) 2024, Software Innovation Institute, ANU. |
| 6 | +/// |
| 7 | +/// Licensed under the GNU General Public License, Version 3 (the "License"). |
| 8 | +/// |
| 9 | +/// License: https://opensource.org/license/gpl-3-0. |
| 10 | +// |
| 11 | +// This program is free software: you can redistribute it and/or modify it under |
| 12 | +// the terms of the GNU General Public License as published by the Free Software |
| 13 | +// Foundation, either version 3 of the License, or (at your option) any later |
| 14 | +// version. |
| 15 | +// |
| 16 | +// This program is distributed in the hope that it will be useful, but WITHOUT |
| 17 | +// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 18 | +// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 19 | +// details. |
| 20 | +// |
| 21 | +// You should have received a copy of the GNU General Public License along with |
| 22 | +// this program. If not, see <https://opensource.org/license/gpl-3-0>. |
| 23 | +/// |
| 24 | +/// Authors: Kevin Wang |
| 25 | +
|
| 26 | +library; |
| 27 | + |
| 28 | +import 'package:flutter/material.dart'; |
| 29 | + |
| 30 | +import 'package:solidpod/solidpod.dart'; |
| 31 | + |
| 32 | +Future<void> aboutDialog(BuildContext context) async { |
| 33 | + final appInfo = await getAppNameVersion(); |
| 34 | + |
| 35 | + // Fix the use_build_context_synchronously lint error. |
| 36 | + |
| 37 | + if (context.mounted) { |
| 38 | + showAboutDialog( |
| 39 | + context: context, |
| 40 | + applicationName: |
| 41 | + '${appInfo.name[0].toUpperCase()}${appInfo.name.substring(1)}', |
| 42 | + applicationVersion: appInfo.version, |
| 43 | + applicationLegalese: '© 2024 Software Innovation Institute ANU', |
| 44 | + applicationIcon: Image.asset( |
| 45 | + 'assets/images/demopod_logo.png', |
| 46 | + width: 100, |
| 47 | + height: 100, |
| 48 | + ), |
| 49 | + children: [ |
| 50 | + const SizedBox( |
| 51 | + width: 300, // Limit the width. |
| 52 | + child: SelectableText('\nA demostrator of SolidPod functionality.\n\n' |
| 53 | + 'Demopod is a demonstrator app for the solidpod package.' |
| 54 | + ' It provides a collection of buttons to exhibit the different' |
| 55 | + ' calabilities provided by solidpod.\n\n' |
| 56 | + 'Authors: Anuska Vidanage, Graham Williams, Dawei Chen.'), |
| 57 | + ), |
| 58 | + ], |
| 59 | + ); |
| 60 | + } |
| 61 | +} |
0 commit comments