diff --git a/lib/screens/home/about_button.dart b/lib/screens/home/about_button.dart new file mode 100644 index 0000000..9df57e8 --- /dev/null +++ b/lib/screens/home/about_button.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:package_info_plus/package_info_plus.dart'; + +/// Button that when pressed shows the about page for the app, including the license page. +class AboutButton extends StatelessWidget { + const AboutButton({super.key}); + + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: () { + PackageInfo.fromPlatform().then((packageInfo) { + showAboutDialog( + context: context, + applicationName: packageInfo.appName, + applicationVersion: packageInfo.version, + applicationIcon: SvgPicture.asset( + 'assets/graphics/CCD.svg', + semanticsLabel: 'CCD Logo', + ), + ); + }); + }, + child: const Text('Show About'), + ); + } +} diff --git a/lib/screens/home/screen.dart b/lib/screens/home/screen.dart index e7a7925..68bec8f 100644 --- a/lib/screens/home/screen.dart +++ b/lib/screens/home/screen.dart @@ -1,3 +1,4 @@ +import 'package:concordium_wallet/screens/home/about_button.dart'; import 'package:concordium_wallet/screens/terms_and_conditions/screen.dart'; import 'package:concordium_wallet/services/url_launcher.dart'; import 'package:concordium_wallet/services/wallet_proxy/service.dart'; @@ -5,8 +6,6 @@ import 'package:concordium_wallet/state/network.dart'; import 'package:concordium_wallet/state/terms_and_conditions.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:package_info_plus/package_info_plus.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @@ -81,22 +80,7 @@ class _HomeScreenState extends State { ], ), ), - ElevatedButton( - onPressed: () { - PackageInfo.fromPlatform().then((packageInfo) { - showAboutDialog( - context: context, - applicationName: packageInfo.appName, - applicationVersion: packageInfo.version, - applicationIcon: SvgPicture.asset( - 'assets/graphics/CCD.svg', - semanticsLabel: 'CCD Logo', - ), - ); - }); - }, - child: const Text('Show About'), - ), + const AboutButton(), const SizedBox(height: 8), ElevatedButton( onPressed: () => context.read().testResetValidTime(), diff --git a/scripts/check_license.dart b/scripts/check_license.dart index 4f290c7..1032ee0 100644 --- a/scripts/check_license.dart +++ b/scripts/check_license.dart @@ -22,14 +22,14 @@ void main() async { required String packageName, required LicenseStatus licenseStatus, }) => - '$packageName $licenseName ${licenseStatus.toString()}', + '$packageName - $licenseName', ); if (lic.isNotEmpty) { - print('Unapproved licenses used!'); + print('Unapproved licenses used, see below:'); for (final x in lic) { print(x.display); } - throw "Unapproved licenses used!"; + throw "Stopping due to unapproved licenses used!"; } }