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

Commit

Permalink
[pull] master from flutter:master (#658)
Browse files Browse the repository at this point in the history
* [connectivity_macos] move NNBD to stable (flutter#3588)

* [cross_file] Stable null safety release (flutter#3593)

* [shared_preferences] Bump platform versions to NNBD stable (flutter#3595)

* [url_launcher] Update platforms to NNBD stable (flutter#3584)

Updates all versions to stable.

Converts all desktop examples to null-safety, and migrates Linux and
macOS to use platform interface for examples rather than app-facing
package to eliminate circular dependencies (implementation copied
directly from Windows).

* [battery] Bump version for NNBD stable (flutter#3594)

Also replaces Mockito with test/Fake since the usage is a simple fake.

* [path_provider] Update to stable NNBD (flutter#3582)

Bumps the versions in the app-facing package to make it stable NNBD.

Changes the interface of four core methods to non-nullable, and adds a new exceptions if they aren't provided by the platform implementations. The list is somewhat arbitrary, but these seem like the four that are core enough that any implementation should either provide them, or explicitly say they don't have such a concept via UnsupportedError, since there isn't an obvious way for a developer to fall back if they are unexpectedly missing.

* [connectivity_macos] fix version (flutter#3599)

* [google_maps_flutter] Bump platform interface version for NNBD stable (flutter#3598)

* [device_info_platform_interface] null safety stable release (flutter#3597)

* [share] Bump version for NNBD stable (flutter#3600)

* [android_intent] Bump version for NNBD stable (flutter#3601)

* [shared_preferences] Bump app-facing version for NNBD stable (flutter#3602)

Co-authored-by: Chris Yang <ychris@google.com>
Co-authored-by: Maurits van Beusekom <maurits@baseflow.com>
Co-authored-by: stuartmorgan <stuartmorgan@google.com>
  • Loading branch information
4 people authored Feb 22, 2021
1 parent 9d00dd2 commit 7b44ac5
Show file tree
Hide file tree
Showing 67 changed files with 406 additions and 550 deletions.
12 changes: 3 additions & 9 deletions packages/android_intent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
## 2.0.0-nullsafety.2

* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.

## 2.0.0-nullsafety.1

* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

## 2.0.0-nullsafety
## 2.0.0

* Migrate to null safety.
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.

## 0.3.7+8

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.9

import 'dart:io';

import 'package:android_intent/android_intent.dart';
Expand Down
4 changes: 2 additions & 2 deletions packages/android_intent/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ dev_dependencies:
path: ../../integration_test
flutter_driver:
sdk: flutter
pedantic: ^1.8.0
pedantic: ^1.10.0

# The following section is specific to Flutter.
flutter:
uses-material-design: true

environment:
sdk: ">=2.3.0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.12.13+hotfix.5"
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.9

import 'dart:async';
import 'dart:convert';
import 'dart:io';
Expand Down
14 changes: 7 additions & 7 deletions packages/android_intent/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: android_intent
description: Flutter plugin for launching Android Intents. Not supported on iOS.
homepage: https://github.com/flutter/plugins/tree/master/packages/android_intent
version: 2.0.0-nullsafety.2
version: 2.0.0

flutter:
plugin:
Expand All @@ -13,15 +13,15 @@ flutter:
dependencies:
flutter:
sdk: flutter
platform: ^3.0.0-nullsafety.4
meta: ^1.3.0-nullsafety.6
platform: ^3.0.0
meta: ^1.3.0
dev_dependencies:
test: ^1.16.0-nullsafety.13
mockito: ^4.1.3
test: ^1.16.3
mockito: ^5.0.0-nullsafety.7
flutter_test:
sdk: flutter
pedantic: ^1.10.0-nullsafety.1
pedantic: ^1.10.0

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.12.13+hotfix.5"
2 changes: 1 addition & 1 deletion packages/battery/battery/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.0.0-nullsafety
## 2.0.0

* Migrate to null safety.

Expand Down
4 changes: 2 additions & 2 deletions packages/battery/battery/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ dev_dependencies:
sdk: flutter
integration_test:
path: ../../../integration_test
pedantic: ^1.10.0-nullsafety
pedantic: ^1.10.0

flutter:
uses-material-design: true

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.12.13+hotfix.5"
14 changes: 7 additions & 7 deletions packages/battery/battery/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: battery
description: Flutter plugin for accessing information about the battery state
(full, charging, discharging) on Android and iOS.
homepage: https://github.com/flutter/plugins/tree/master/packages/battery/battery
version: 2.0.0-nullsafety
version: 2.0.0

flutter:
plugin:
Expand All @@ -16,18 +16,18 @@ flutter:
dependencies:
flutter:
sdk: flutter
meta: ^1.3.0-nullsafety
battery_platform_interface: ^2.0.0-nullsafety
meta: ^1.3.0
battery_platform_interface: ^2.0.0

dev_dependencies:
mockito: ^5.0.0-nullsafety.0
flutter_test:
sdk: flutter
plugin_platform_interface: ^1.1.0-nullsafety
plugin_platform_interface: ">=1.0.0 <3.0.0"
integration_test:
path: ../../integration_test
pedantic: ^1.10.0-nullsafety
pedantic: ^1.10.0
test: ^1.16.3

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.12.13+hotfix.5"
6 changes: 3 additions & 3 deletions packages/battery/battery/test/battery_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import 'dart:async';

import 'package:battery/battery.dart';
import 'package:battery_platform_interface/battery_platform_interface.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:battery/battery.dart';
import 'package:mockito/mockito.dart';
import 'package:test/fake.dart';

void main() {
group('battery', () {
Expand All @@ -30,7 +30,7 @@ void main() {
});
}

class MockBatteryPlatform extends Mock
class MockBatteryPlatform extends Fake
with MockPlatformInterfaceMixin
implements BatteryPlatform {
Future<int> batteryLevel() async {
Expand Down
11 changes: 2 additions & 9 deletions packages/connectivity/connectivity_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
## 2.0.0-nullsafety

* Update version to (semi-belatedly) meet 1.0-consistency promise.

## 0.2.0-nullsafety.1
## 0.2.0

* Remove placeholder Dart file.

## 0.2.0-nullsafety

* Update Dart SDK constraint.
* Update Dart SDK constraint for compatibility with null safety.

## 0.1.0+8

Expand Down
14 changes: 7 additions & 7 deletions packages/connectivity/connectivity_macos/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import 'dart:async';
import 'dart:io';

import 'package:connectivity/connectivity.dart';
import 'package:connectivity_platform_interface/connectivity_platform_interface.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -40,18 +40,18 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
MyHomePage({Key? key, this.title}) : super(key: key);

final String title;
final String? title;

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
String _connectionStatus = 'Unknown';
final Connectivity _connectivity = Connectivity();
StreamSubscription<ConnectivityResult> _connectivitySubscription;
final ConnectivityPlatform _connectivity = ConnectivityPlatform.instance;
late StreamSubscription<ConnectivityResult> _connectivitySubscription;

@override
void initState() {
Expand All @@ -69,7 +69,7 @@ class _MyHomePageState extends State<MyHomePage> {

// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initConnectivity() async {
ConnectivityResult result;
late ConnectivityResult result;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
result = await _connectivity.checkConnectivity();
Expand Down Expand Up @@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
Future<void> _updateConnectionStatus(ConnectivityResult result) async {
switch (result) {
case ConnectivityResult.wifi:
String wifiName, wifiBSSID, wifiIP;
String? wifiName, wifiBSSID, wifiIP;

try {
if (Platform.isIOS) {
Expand Down
6 changes: 3 additions & 3 deletions packages/connectivity/connectivity_macos/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Demonstrates how to use the connectivity plugin.
dependencies:
flutter:
sdk: flutter
connectivity: any
connectivity_platform_interface: ^2.0.0
connectivity_macos:
# When depending on this package from a real application you should use:
# connectivity_macos: ^x.y.z
Expand All @@ -18,11 +18,11 @@ dev_dependencies:
sdk: flutter
integration_test:
path: ../../../integration_test
pedantic: ^1.8.0
pedantic: ^1.10.0

flutter:
uses-material-design: true

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.10.0"
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.9
import 'dart:io';
import 'package:integration_test/integration_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:connectivity/connectivity.dart';
import 'package:connectivity_platform_interface/connectivity_platform_interface.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

group('Connectivity test driver', () {
Connectivity _connectivity;
ConnectivityPlatform _connectivity;

setUpAll(() async {
_connectivity = Connectivity();
_connectivity = ConnectivityPlatform.instance;
});

testWidgets('test connectivity result', (WidgetTester tester) async {
Expand Down
6 changes: 3 additions & 3 deletions packages/connectivity/connectivity_macos/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: connectivity_macos
description: macOS implementation of the connectivity plugin.
version: 2.0.0-nullsafety
version: 0.2.0
homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity/connectivity_macos

flutter:
Expand All @@ -10,12 +10,12 @@ flutter:
pluginClass: ConnectivityPlugin

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.10.0"

dependencies:
flutter:
sdk: flutter

dev_dependencies:
pedantic: ^1.8.0
pedantic: ^1.10.0
2 changes: 1 addition & 1 deletion packages/cross_file/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.3.0-nullsafety
## 0.3.0

* Migrated package to null-safety.
* **breaking change** According to our unit tests, the API should be backwards-compatible. Some relevant changes were made, however:
Expand Down
8 changes: 4 additions & 4 deletions packages/cross_file/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: cross_file
description: An abstraction to allow working with files across multiple platforms.
homepage: https://github.com/flutter/plugins/tree/master/packages/cross_file
version: 0.3.0-nullsafety
version: 0.3.0

dependencies:
flutter:
sdk: flutter
meta: ^1.3.0-nullsafety.3
meta: ^1.3.0

dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.10.0-nullsafety.3
pedantic: ^1.10.0

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.22.0"
11 changes: 2 additions & 9 deletions packages/device_info/device_info_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
## 2.0.0-nullsafety.2
## 2.0.0

* Migrate to null safety.
* Make `baseOS`, `previewSdkInt`, and `securityPatch` nullable types.
* Remove default values for non-nullable types.

## 2.0.0-nullsafety.1

* Bump Dart SDK to support null safety.

## 2.0.0-nullsafety

* Migrate to null safety.

## 1.0.2

- Update Flutter SDK constraint.
Expand Down
12 changes: 6 additions & 6 deletions packages/device_info/device_info_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ description: A common platform interface for the device_info plugin.
homepage: https://github.com/flutter/plugins/tree/master/packages/device_info
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 2.0.0-nullsafety.2
version: 2.0.0

dependencies:
flutter:
sdk: flutter
meta: ^1.3.0-nullsafety.3
plugin_platform_interface: ^1.1.0-nullsafety.1
meta: ^1.3.0
plugin_platform_interface: ">=1.0.0 <3.0.0"

dev_dependencies:
flutter_test:
sdk: flutter
test: ^1.10.0-nullsafety.1
pedantic: ^1.10.0-nullsafety.1
test: ^1.16.3
pedantic: ^1.10.0

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.9.1+hotfix.4"
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
## 2.0.0-nullsafety.1

* Fix overly-restrictive type check.

## 2.0.0-nullsafety
## 2.0.0

* Migrated to null-safety.
* BREAKING CHANGE: Removed deprecated APIs.
Expand Down
Loading

0 comments on commit 7b44ac5

Please sign in to comment.