From 3d5dbe2c85d532c8e94ac60dc903c32b3076a59b Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Thu, 10 Feb 2022 00:52:12 -0500 Subject: [PATCH] Add `package_info_plus` package, upgrade packges --- ios/Podfile.lock | 2 +- lib/constants/constants.dart | 3 --- .../settings/sections/other_settings.dart | 17 +++++++++++------ pubspec.lock | 12 ++++++------ 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index cdb42d18..65031ea4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -76,7 +76,7 @@ SPEC CHECKSUMS: path_provider_ios: 7d7ce634493af4477d156294792024ec3485acd5 Sentry: 2f7e91f247cfb05b05bd01e0b5d0692557a7687b sentry_flutter: 7c3cb050dc23563a4ea5db438c83afdb460a2ae6 - shared_preferences_ios: aef470a42dc4675a1cdd50e3158b42e3d1232b32 + shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de webview_flutter_wkwebview: 005fbd90c888a42c5690919a1527ecc6649e1162 diff --git a/lib/constants/constants.dart b/lib/constants/constants.dart index 3736292f..527fe476 100644 --- a/lib/constants/constants.dart +++ b/lib/constants/constants.dart @@ -4,9 +4,6 @@ const clientId = String.fromEnvironment('CLIENT_ID'); /// Twitch API client secret. const secret = String.fromEnvironment('SECRET'); -/// The current version of the app. -const appVersion = '1.0.0'; - /// The tracesSampleRate for sentry crash reporting. const sampleRate = 1.0; diff --git a/lib/screens/settings/sections/other_settings.dart b/lib/screens/settings/sections/other_settings.dart index c53fb82a..1771e09e 100644 --- a/lib/screens/settings/sections/other_settings.dart +++ b/lib/screens/settings/sections/other_settings.dart @@ -4,6 +4,7 @@ import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:frosty/constants/constants.dart'; import 'package:frosty/screens/settings/stores/settings_store.dart'; import 'package:frosty/widgets/section_header.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; class OtherSettings extends StatelessWidget { @@ -25,12 +26,16 @@ class OtherSettings extends StatelessWidget { ListTile( leading: const Icon(Icons.info), title: const Text('About'), - onTap: () => showAboutDialog( - context: context, - applicationName: 'Frosty', - applicationVersion: appVersion, - applicationLegalese: '\u{a9} 2022 Tommy Chow', - ), + onTap: () async { + final packageInfo = await PackageInfo.fromPlatform(); + + showAboutDialog( + context: context, + applicationName: packageInfo.appName, + applicationVersion: 'Version ${packageInfo.version} build ${packageInfo.buildNumber}', + applicationLegalese: '\u{a9} 2022 Tommy Chow', + ); + }, ), Observer( builder: (_) => SwitchListTile.adaptive( diff --git a/pubspec.lock b/pubspec.lock index 721a6420..91f36004 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -507,7 +507,7 @@ packages: source: hosted version: "2.0.2" package_info_plus: - dependency: transitive + dependency: "direct main" description: name: package_info_plus url: "https://pub.dartlang.org" @@ -722,28 +722,28 @@ packages: name: shared_preferences_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.10" + version: "2.0.11" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.10" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.1.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" shared_preferences_platform_interface: dependency: transitive description: @@ -764,7 +764,7 @@ packages: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.1.0" shelf: dependency: transitive description: