Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjort committed Nov 24, 2023
1 parent 9d09750 commit 75cf48e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 21 deletions.
28 changes: 28 additions & 0 deletions lib/screens/home/about_button.dart
Original file line number Diff line number Diff line change
@@ -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'),
);
}
}
20 changes: 2 additions & 18 deletions lib/screens/home/screen.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
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';
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});
Expand Down Expand Up @@ -81,22 +80,7 @@ class _HomeScreenState extends State<HomeScreen> {
],
),
),
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<TermsAndConditionAcceptance>().testResetValidTime(),
Expand Down
6 changes: 3 additions & 3 deletions scripts/check_license.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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!";
}
}

0 comments on commit 75cf48e

Please sign in to comment.