Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
seperate declaration and return statement
  • Loading branch information
bparrishMines committed Jan 11, 2021
commit 7092d001c94f142274a5b5dbece33e6a5b787d71
7 changes: 5 additions & 2 deletions packages/package_info/lib/package_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@ class PackageInfo {
/// Retrieves package information from the platform.
/// The result is cached.
static Future<PackageInfo> fromPlatform() async {
final PackageInfo? packageInfo = _fromPlatform;
PackageInfo? packageInfo = _fromPlatform;
if (packageInfo != null) return packageInfo;

final Map<String, dynamic> map =
(await _kChannel.invokeMapMethod<String, dynamic>('getAll'))!;
return _fromPlatform = PackageInfo(

packageInfo = PackageInfo(
appName: map["appName"],
packageName: map["packageName"],
version: map["version"],
buildNumber: map["buildNumber"],
);
_fromPlatform = packageInfo;
return packageInfo;
}

/// The app name. `CFBundleDisplayName` on iOS, `application/label` on Android.
Expand Down