Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 72cbcac

Browse files
[package_info] Bump version for NNBD stable (#3571)
Includes: - Migrating the example to NNBD - Bullet-proofing against null values from the native code; at least the ObjC code can theoretically return nulls.
1 parent 51c6eac commit 72cbcac

File tree

8 files changed

+22
-31
lines changed

8 files changed

+22
-31
lines changed

packages/package_info/CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
## 2.0.0-nullsafety
2-
3-
* Update version to (semi-belatedly) meet 1.0-consistency promise.
4-
5-
## 0.5.0-nullsafety
1+
## 2.0.0
62

73
* Migrate to null safety.
84

packages/package_info/example/integration_test/package_info_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// @dart=2.9
6+
57
import 'dart:io';
68
import 'package:flutter_test/flutter_test.dart';
79
import 'package:integration_test/integration_test.dart';

packages/package_info/example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MyApp extends StatelessWidget {
2525
}
2626

2727
class MyHomePage extends StatefulWidget {
28-
MyHomePage({Key key, this.title}) : super(key: key);
28+
MyHomePage({Key? key, required this.title}) : super(key: key);
2929

3030
final String title;
3131

@@ -57,7 +57,7 @@ class _MyHomePageState extends State<MyHomePage> {
5757
Widget _infoTile(String title, String subtitle) {
5858
return ListTile(
5959
title: Text(title),
60-
subtitle: Text(subtitle ?? 'Not set'),
60+
subtitle: Text(subtitle.isNotEmpty ? subtitle : 'Not set'),
6161
);
6262
}
6363

packages/package_info/example/macos/Runner.xcodeproj/project.pbxproj

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@
2626
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
2727
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
2828
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
29-
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; };
30-
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3129
9A0CC0B8F23AFE5DF719BADB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CED91D820ABAEDEBEFEBDBDA /* Pods_Runner.framework */; };
32-
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; };
33-
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3430
/* End PBXBuildFile section */
3531

3632
/* Begin PBXContainerItemProxy section */
@@ -50,8 +46,6 @@
5046
dstPath = "";
5147
dstSubfolderSpec = 10;
5248
files = (
53-
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */,
54-
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */,
5549
);
5650
name = "Bundle Framework";
5751
runOnlyForDeploymentPostprocessing = 0;
@@ -72,24 +66,20 @@
7266
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
7367
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
7468
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
75-
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; };
7669
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
7770
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
7871
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
7972
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
8073
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
8174
B3868D4F5169B9990BB5D1F5 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
8275
CED91D820ABAEDEBEFEBDBDA /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
83-
D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; };
8476
/* End PBXFileReference section */
8577

8678
/* Begin PBXFrameworksBuildPhase section */
8779
33CC10EA2044A3C60003C045 /* Frameworks */ = {
8880
isa = PBXFrameworksBuildPhase;
8981
buildActionMask = 2147483647;
9082
files = (
91-
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
92-
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
9383
9A0CC0B8F23AFE5DF719BADB /* Pods_Runner.framework in Frameworks */,
9484
);
9585
runOnlyForDeploymentPostprocessing = 0;
@@ -145,8 +135,6 @@
145135
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
146136
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
147137
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
148-
D73912EF22F37F9E000D13A0 /* App.framework */,
149-
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */,
150138
);
151139
path = Flutter;
152140
sourceTree = "<group>";
@@ -280,7 +268,7 @@
280268
);
281269
runOnlyForDeploymentPostprocessing = 0;
282270
shellPath = /bin/sh;
283-
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n";
271+
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
284272
};
285273
33CC111E2044C6BF0003C045 /* ShellScript */ = {
286274
isa = PBXShellScriptBuildPhase;
@@ -329,10 +317,13 @@
329317
buildActionMask = 2147483647;
330318
files = (
331319
);
332-
inputFileListPaths = (
320+
inputPaths = (
321+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
322+
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
333323
);
334324
name = "[CP] Embed Pods Frameworks";
335-
outputFileListPaths = (
325+
outputPaths = (
326+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
336327
);
337328
runOnlyForDeploymentPostprocessing = 0;
338329
shellPath = /bin/sh;

packages/package_info/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ dependencies:
1717
dev_dependencies:
1818
flutter_driver:
1919
sdk: flutter
20-
pedantic: ^1.8.0
20+
pedantic: ^1.10.0
2121

2222
flutter:
2323
uses-material-design: true
2424

2525
environment:
26-
sdk: ">=2.1.0 <3.0.0"
26+
sdk: ">=2.12.0-259.9.beta <3.0.0"
2727
flutter: ">=1.12.13+hotfix.5"

packages/package_info/example/test_driver/integration_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// @dart=2.9
6+
57
import 'dart:convert';
68
import 'dart:io';
79

packages/package_info/lib/package_info.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ class PackageInfo {
4242
(await _kChannel.invokeMapMethod<String, dynamic>('getAll'))!;
4343

4444
packageInfo = PackageInfo(
45-
appName: map["appName"],
46-
packageName: map["packageName"],
47-
version: map["version"],
48-
buildNumber: map["buildNumber"],
45+
appName: map["appName"] ?? '',
46+
packageName: map["packageName"] ?? '',
47+
version: map["version"] ?? '',
48+
buildNumber: map["buildNumber"] ?? '',
4949
);
5050
_fromPlatform = packageInfo;
5151
return packageInfo;

packages/package_info/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: package_info
22
description: Flutter plugin for querying information about the application
33
package, such as CFBundleVersion on iOS or versionCode on Android.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/package_info
5-
version: 2.0.0-nullsafety
5+
version: 2.0.0
66

77
flutter:
88
plugin:
@@ -26,8 +26,8 @@ dev_dependencies:
2626
sdk: flutter
2727
integration_test:
2828
path: ../integration_test
29-
pedantic: ^1.10.0-nullsafety
29+
pedantic: ^1.10.0
3030

3131
environment:
32-
sdk: ">=2.12.0-0 <3.0.0"
32+
sdk: ">=2.12.0-259.9.beta <3.0.0"
3333
flutter: ">=1.12.13+hotfix.5"

0 commit comments

Comments
 (0)