Skip to content

Commit

Permalink
Add about box and bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jchown committed Dec 29, 2020
1 parent df4fc96 commit f29e516
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
21 changes: 21 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import 'package:flutter/services.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:yaml/yaml.dart';

import 'annotations.dart';
import 'annotate_git.dart';
Expand Down Expand Up @@ -232,6 +234,10 @@ class _MainPageState extends State<MainPage> {
onChanged: (double value) =>
setFontHeight((value * 10).floorToDouble() / 10))
]),
ListTile(
leading: Icon(Icons.info),
title: Text('About YellowSnow'),
onTap: onAbout),
],
),
);
Expand Down Expand Up @@ -355,6 +361,21 @@ class _MainPageState extends State<MainPage> {
if (file != null && file.existsSync()) load(file.path);
}

Future<void> onAbout() async {

var pubspec = await rootBundle.loadString("pubspec.yaml");
var yaml = loadYaml(pubspec);
var version = yaml["version"];

AwesomeDialog(
context: context,
dialogType: DialogType.NO_HEADER,
title: 'About YellowSnow',
desc: '\nAuthor: Jason Chown\n\nVersion: $version\n',
btnOkOnPress: () {},
)..show();
}

void handleLineClick(Line line) {
if (line.getFilename() != null) load(line.getFilename());
}
Expand Down
63 changes: 63 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.2"
awesome_dialog:
dependency: "direct main"
description:
name: awesome_dialog
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -113,6 +120,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flare_dart:
dependency: transitive
description:
name: flare_dart
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.4"
flare_flutter:
dependency: transitive
description:
name: flare_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -196,6 +217,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+3"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.2"
petitparser:
dependency: transitive
description:
Expand Down Expand Up @@ -224,6 +252,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.13"
sa_v1_migration:
dependency: transitive
description:
name: sa_v1_migration
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
shared_preferences:
dependency: "direct main"
description:
Expand Down Expand Up @@ -266,6 +301,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+3"
simple_animations:
dependency: transitive
description:
name: simple_animations
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
sky_engine:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -299,6 +341,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.2"
supercharged:
dependency: transitive
description:
name: supercharged
url: "https://pub.dartlang.org"
source: hosted
version: "1.12.0"
supercharged_dart:
dependency: transitive
description:
name: supercharged_dart
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
term_glyph:
dependency: transitive
description:
Expand Down Expand Up @@ -348,6 +404,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.5.1"
yaml:
dependency: "direct main"
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.11.0-0.0 <=2.12.0-3.0.dev"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
7 changes: 5 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: yellow_snow
description: See where your fellow developers left their mark

publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.1.0
version: 0.1.1

environment:
sdk: ">=2.7.0 <3.0.0"
Expand All @@ -16,6 +16,8 @@ dependencies:
image: ^2.1.18
filepicker_windows: ^1.0.0
easy_localization: ^2.3.3
awesome_dialog: ^1.2.1
yaml: ^2.2.1

dev_dependencies:
flutter_test:
Expand All @@ -33,4 +35,5 @@ flutter:

assets:
- assets/images/
- assets/translations/
- assets/translations/
- pubspec.yaml

0 comments on commit f29e516

Please sign in to comment.