Skip to content

Commit d441566

Browse files
[various] Replaces deprecated whereNotNull() (#8215)
Replaces the `whereNotNull()` method from `pkg:collection` with the Dart core `nonNulls`. `nonNulls` has been available in Dart since 3.0, so no dependency or SDK requirement changes are necessary. Fixes flutter/flutter#159738
1 parent bf41945 commit d441566

File tree

7 files changed

+14
-7
lines changed

7 files changed

+14
-7
lines changed

packages/go_router/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 14.6.2
2+
3+
- Replaces deprecated collection method usage.
4+
15
## 14.6.1
26

37
- Fixed `PopScope`, and `WillPopScop` was not handled properly in the Root routes.

packages/go_router/lib/src/route.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ class StatefulShellRoute extends ShellRouteBase {
978978
String? restorationScopeId, List<StatefulShellBranch> branches) {
979979
if (branches
980980
.map((StatefulShellBranch e) => e.restorationScopeId)
981-
.whereNotNull()
981+
.nonNulls
982982
.isNotEmpty) {
983983
assert(
984984
restorationScopeId != null,

packages/go_router/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: go_router
22
description: A declarative router for Flutter based on Navigation 2 supporting
33
deep linking, data-driven routes and more
4-
version: 14.6.1
4+
version: 14.6.2
55
repository: https://github.com/flutter/packages/tree/main/packages/go_router
66
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22
77

packages/pigeon/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 22.6.3
2+
3+
* Replaces deprecated collection method usage.
4+
15
## 22.6.2
26

37
* Removes the `@protected` annotation from the InstanceManager field of the

packages/pigeon/lib/generator_tools.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'ast.dart';
1414
/// The current version of pigeon.
1515
///
1616
/// This must match the version in pubspec.yaml.
17-
const String pigeonVersion = '22.6.2';
17+
const String pigeonVersion = '22.6.3';
1818

1919
/// Read all the content from [stdin] to a String.
2020
String readStdin() {

packages/pigeon/lib/swift_generator.dart

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

5-
import 'package:collection/collection.dart' as collection;
65
import 'package:graphs/graphs.dart';
76
import 'package:pub_semver/pub_semver.dart';
87

@@ -158,7 +157,7 @@ class SwiftGenerator extends StructuredGenerator<SwiftOptions> {
158157
final Iterable<String> proxyApiImports = root.apis
159158
.whereType<AstProxyApi>()
160159
.map((AstProxyApi proxyApi) => proxyApi.swiftOptions?.import)
161-
.whereNotNull()
160+
.nonNulls
162161
.toSet();
163162
for (final String import in proxyApiImports) {
164163
indent.writeln('import $import');
@@ -404,7 +403,7 @@ static func fromList(_ ${varNamePrefix}list: [Any?]) -> Any? {
404403
type: type,
405404
wrapped: wrapped
406405
)
407-
406+
408407
return wrapper.unwrap()
409408
}
410409
''');

packages/pigeon/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pigeon
22
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
33
repository: https://github.com/flutter/packages/tree/main/packages/pigeon
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22
5-
version: 22.6.2 # This must match the version in lib/generator_tools.dart
5+
version: 22.6.3 # This must match the version in lib/generator_tools.dart
66

77
environment:
88
sdk: ^3.3.0

0 commit comments

Comments
 (0)