Skip to content

Commit

Permalink
Add package_info_plus so we can read our own version number and inclu…
Browse files Browse the repository at this point in the history
…de in the exported data.
  • Loading branch information
akiller authored and rydmike committed Oct 19, 2024
1 parent 4439d9b commit d0664e1
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions example/lib/example5_themes_playground/utils/version.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:package_info_plus/package_info_plus.dart';

/// Get version of this app
Future<String> getVersion() {
return PackageInfo.fromPlatform().then(
(PackageInfo value) => value.version,
);
}
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
import FlutterMacOS
import Foundation

import package_info_plus
import path_provider_foundation
import shared_preferences_foundation
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
Expand Down
24 changes: 24 additions & 0 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.15.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: df3eb3e0aed5c1107bb0fdb80a8e82e778114958b1c5ac5644fb1ac9cae8a998
url: "https://pub.dev"
source: hosted
version: "8.1.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66
url: "https://pub.dev"
source: hosted
version: "3.0.1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -612,6 +628,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
win32:
dependency: transitive
description:
name: win32
sha256: e5c39a90447e7c81cfec14b041cdbd0d0916bd9ebbc7fe02ab69568be703b9bd
url: "https://pub.dev"
source: hosted
version: "5.6.0"
xdg_directories:
dependency: transitive
description:
Expand Down
4 changes: 4 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ dependencies:
# https://pub.dev/packages/hive
hive: ^2.2.3

# So we can read the version of this app at runtime
# https://pub.dev/packages/package_info_plus
package_info_plus: ^8.1.0

# Commonly used directories on host platform file systems, by Google (flutter.dev).
# Used to get a working storage path for Hive on Windows.
# https://pub.dev/packages/path_provider
Expand Down

0 comments on commit d0664e1

Please sign in to comment.