Skip to content

Commit 7504f34

Browse files
Emmanuel Garciamvanbeusekom
authored andcommitted
[plugin_platform_interface] Migrate to null safety (flutter#3115)
1 parent a346783 commit 7504f34

File tree

6 files changed

+22
-11
lines changed

6 files changed

+22
-11
lines changed

.cirrus.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ task:
3737
# https://github.com/flutter/flutter/issues/42864
3838
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
3939
- flutter channel $CHANNEL
40-
- ./script/incremental_build.sh test
40+
- ./script/incremental_build.sh test --enable-experiment=non-nullable
4141
- name: analyze
4242
script: ./script/incremental_build.sh analyze
4343
- name: build_all_plugins_apk
@@ -87,13 +87,13 @@ task:
8787
- echo "$CIRRUS_COMMIT_MESSAGE" > /tmp/cirrus_commit_message.txt
8888
- export CIRRUS_CHANGE_MESSAGE=""
8989
- export CIRRUS_COMMIT_MESSAGE=""
90-
- ./script/incremental_build.sh build-examples --apk
90+
- ./script/incremental_build.sh build-examples --apk --enable-experiment=non-nullable
9191
- ./script/incremental_build.sh java-test # must come after apk build
9292
- if [[ $GCLOUD_FIREBASE_TESTLAB_KEY == ENCRYPTED* ]]; then
9393
- echo "This user does not have permission to run Firebase Test Lab tests."
9494
- else
9595
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
96-
- ./script/incremental_build.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26
96+
- ./script/incremental_build.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --enable-experiment=non-nullable
9797
- fi
9898
- export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt`
9999
- export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt`
@@ -177,8 +177,8 @@ task:
177177
# https://github.com/flutter/flutter/issues/42864
178178
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
179179
- flutter channel $CHANNEL
180-
- ./script/incremental_build.sh build-examples --ipa
181-
- ./script/incremental_build.sh drive-examples
180+
- ./script/incremental_build.sh build-examples --ipa --enable-experiment=non-nullable
181+
- ./script/incremental_build.sh drive-examples --enable-experiment=non-nullable
182182
task:
183183
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
184184
only_if: $CIRRUS_TAG == ''

analysis_options.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include: package:pedantic/analysis_options.1.8.0.yaml
22
analyzer:
3+
enable-experiment:
4+
- non-nullable
35
exclude:
46
# Ignore generated files
57
- '**/*.g.dart'

packages/plugin_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.0-nullsafety
2+
3+
* Migrate to null safety.
4+
15
## 1.0.3
26

37
* Fix homepage in `pubspec.yaml`.

packages/plugin_platform_interface/lib/plugin_platform_interface.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import 'package:meta/meta.dart';
4141
/// [MockPlatformInterfaceMixin] for a sample of using Mockito to mock a platform interface.
4242
abstract class PlatformInterface {
4343
/// Pass a private, class-specific `const Object()` as the `token`.
44-
PlatformInterface({@required Object token}) : _instanceToken = token;
44+
PlatformInterface({required Object token}) : _instanceToken = token;
4545

4646
final Object _instanceToken;
4747

packages/plugin_platform_interface/pubspec.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ description: Reusable base class for Flutter plugin platform interfaces.
1212
# be done when absolutely necessary and after the ecosystem has already migrated to 1.X.Y version
1313
# that is forward compatible with 2.0.0 (ideally the ecosystem have migrated to depend on:
1414
# `plugin_platform_interface: >=1.X.Y <3.0.0`).
15-
version: 1.0.3
15+
version: 1.1.0-nullsafety
1616

1717
repository: https://github.com/flutter/plugins/tree/master/packages/plugin_platform_interface
1818

1919
environment:
20-
sdk: ">=2.1.0 <3.0.0"
20+
sdk: '>=2.10.0-56.0.dev <3.0.0'
21+
22+
# Don't publish this package until null safety is stable or the package is in the allow list.
23+
publish_to: none
2124

2225
dependencies:
23-
meta: ^1.0.0
26+
meta: ^1.3.0-nullsafety.3
2427

2528
dev_dependencies:
2629
mockito: ^4.1.1
27-
test: ^1.9.4
28-
pedantic: ^1.8.0
30+
test: ^1.10.0-nullsafety.1
31+
pedantic: ^1.10.0-nullsafety.1

packages/plugin_platform_interface/test/plugin_platform_interface_test.dart

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

5+
// TODO(egarciad): Remove once Mockito is migrated to null safety.
6+
// @dart = 2.9
57
import 'package:mockito/mockito.dart';
68
import 'package:test/test.dart';
79

0 commit comments

Comments
 (0)