diff --git a/.gitignore b/.gitignore index 9d532b1..e70c7f6 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ app.*.symbols # Obfuscation related app.*.map.json + +# Keys +keys/keystore.jks \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c79c9d..ed4d88e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ ## [0.12.0] - 2020-02-17 ### Added - Refactor game edit page. -- Refactor game view page. - Refactor game in list edit page. - Refactor game in list view page. +- Refactor game view page. +- Show app version in settings tab. ## [0.11.0] - 2020-02-16 ### Added diff --git a/android/app/build.gradle b/android/app/build.gradle index 673ac8e..1fd3abb 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -25,7 +25,14 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" -android { + def keystoreProperties = new Properties() + def keystorePropertiesFile = rootProject.file('key.properties') + if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + } + + android { + compileSdkVersion 29 sourceSets { @@ -45,11 +52,20 @@ android { versionName flutterVersionName } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + } buildTypes { + release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release } } } @@ -60,4 +76,4 @@ flutter { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6faa238..947a2eb 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -44,4 +44,5 @@ android:name="flutterEmbedding" android:value="2" /> + diff --git a/lib/pages/tabs/settings_tab.dart b/lib/pages/tabs/settings_tab.dart index 3a41fe1..2488926 100644 --- a/lib/pages/tabs/settings_tab.dart +++ b/lib/pages/tabs/settings_tab.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; +import 'package:package_info/package_info.dart'; -class SettingsTab extends StatelessWidget { +class SettingsTab extends StatefulWidget { final bool isDarkTheme; final ValueChanged updateIsDarkTheme; @@ -8,6 +9,14 @@ class SettingsTab extends StatelessWidget { {Key key, @required this.isDarkTheme, @required this.updateIsDarkTheme}) : super(key: key); + @override + _SettingsTabState createState() => _SettingsTabState(); +} + +class _SettingsTabState extends State { + String _appName; + String _version; + @override Widget build(BuildContext context) { return ListView( @@ -21,18 +30,40 @@ class SettingsTab extends StatelessWidget { padding: const EdgeInsets.all(8.0), child: Column( children: [ - Text('Appearance'), + Text( + 'Appearance', + style: TextStyle(fontSize: 16), + ), SwitchListTile( title: Text('Dark Theme'), - value: isDarkTheme, + value: widget.isDarkTheme, onChanged: (value) { - updateIsDarkTheme(value); - }) + widget.updateIsDarkTheme(value); + }), ], ), ), - ) + ), + Center( + child: Text('$_appName $_version'), + ), ], ); } + + _getVersion() async { + var packageInfo = await PackageInfo.fromPlatform(); + setState(() { + _appName = packageInfo.appName; + _version = packageInfo.version; + }); + } + + @override + void initState() { + _appName = ''; + _version = ''; + _getVersion(); + super.initState(); + } } diff --git a/pubspec.lock b/pubspec.lock index 503f20f..d4853a6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -230,6 +230,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_automation: + dependency: "direct main" + description: + name: flutter_automation + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" flutter_test: dependency: "direct dev" description: flutter @@ -254,6 +261,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.2.0" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" http_multi_server: dependency: transitive description: @@ -345,6 +359,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.9.3" + package_info: + dependency: "direct main" + description: + name: package_info + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.3+4" path: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 504bb26..0bada33 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.11.0 +version: 0.12.0 environment: sdk: ">=2.7.0 <3.0.0" @@ -25,6 +25,8 @@ dependencies: sdk: flutter shared_preferences: ^0.5.12+4 floor: ^0.18.0 + flutter_automation: ^1.4.0 + package_info: ^0.4.3+4 # The following adds the Cupertino Icons font to your application.