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

Commit

Permalink
Licenses (#19)
Browse files Browse the repository at this point in the history
## Purpose

Add licenses attribution.

## Changes

- Added a button for displaying app about page ( + license page), from
the material library.
- Added a script that can check licenses in dependencies.
- Added check to CI that only approved licenses are being used. 

## Checklist

- [x] My code follows the style of this project.
- [x] The code compiles without warnings.
- [x] I have performed a self-review of the changes.
- [x] I have documented my code, in particular the intent of the
      hard-to-understand areas.
- [ ] (If necessary) I have updated the CHANGELOG.
  • Loading branch information
shjortConcordium authored Nov 30, 2023
2 parents a61b5c9 + e86a8b8 commit ea4a02b
Show file tree
Hide file tree
Showing 9 changed files with 276 additions and 38 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ env:
flutter_version: 3.13.6

jobs:
check-licenses:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
channel: 'stable'
cache: true

- run: dart pub get

- name: Check licenses
run: dart run scripts/check_license.dart

analyze-format:
runs-on: ubuntu-22.04
steps:
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ See for example [`wallet_proxy/model.dart`](./lib/services/wallet_proxy/model.da
which expands into [`wallet_proxy/model.g.dart`](./lib/services/wallet_proxy/model.g.dart).

The generated class is checked into the repo, but imports always refer to the original one.

## Licenses

To see the allowed licenses, check out `scripts/license.yaml`.

To get a (readable) list of the licenses of dependencies run:
```
dart run license_checker check-licenses --config scripts/license.yaml
```
3 changes: 3 additions & 0 deletions assets/graphics/CCD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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'),
);
}
}
3 changes: 3 additions & 0 deletions lib/screens/home/screen.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -79,6 +80,8 @@ class _HomeScreenState extends State<HomeScreen> {
],
),
),
const AboutButton(),
const SizedBox(height: 8),
ElevatedButton(
onPressed: () => context.read<TermsAndConditionAcceptance>().testResetValidTime(),
child: const Text('Reset update time of valid T&C'),
Expand Down
Loading

0 comments on commit ea4a02b

Please sign in to comment.