Skip to content

Commit

Permalink
[various] Replaces deprecated whereNotNull() (#8215)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stuartmorgan authored Dec 3, 2024
1 parent bf41945 commit d441566
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions packages/go_router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 14.6.2

- Replaces deprecated collection method usage.

## 14.6.1

- Fixed `PopScope`, and `WillPopScop` was not handled properly in the Root routes.
Expand Down
2 changes: 1 addition & 1 deletion packages/go_router/lib/src/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ class StatefulShellRoute extends ShellRouteBase {
String? restorationScopeId, List<StatefulShellBranch> branches) {
if (branches
.map((StatefulShellBranch e) => e.restorationScopeId)
.whereNotNull()
.nonNulls
.isNotEmpty) {
assert(
restorationScopeId != null,
Expand Down
2 changes: 1 addition & 1 deletion packages/go_router/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: go_router
description: A declarative router for Flutter based on Navigation 2 supporting
deep linking, data-driven routes and more
version: 14.6.1
version: 14.6.2
repository: https://github.com/flutter/packages/tree/main/packages/go_router
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22

Expand Down
4 changes: 4 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 22.6.3

* Replaces deprecated collection method usage.

## 22.6.2

* Removes the `@protected` annotation from the InstanceManager field of the
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/lib/generator_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'ast.dart';
/// The current version of pigeon.
///
/// This must match the version in pubspec.yaml.
const String pigeonVersion = '22.6.2';
const String pigeonVersion = '22.6.3';

/// Read all the content from [stdin] to a String.
String readStdin() {
Expand Down
5 changes: 2 additions & 3 deletions packages/pigeon/lib/swift_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:collection/collection.dart' as collection;
import 'package:graphs/graphs.dart';
import 'package:pub_semver/pub_semver.dart';

Expand Down Expand Up @@ -158,7 +157,7 @@ class SwiftGenerator extends StructuredGenerator<SwiftOptions> {
final Iterable<String> proxyApiImports = root.apis
.whereType<AstProxyApi>()
.map((AstProxyApi proxyApi) => proxyApi.swiftOptions?.import)
.whereNotNull()
.nonNulls
.toSet();
for (final String import in proxyApiImports) {
indent.writeln('import $import');
Expand Down Expand Up @@ -404,7 +403,7 @@ static func fromList(_ ${varNamePrefix}list: [Any?]) -> Any? {
type: type,
wrapped: wrapped
)
return wrapper.unwrap()
}
''');
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pigeon
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
repository: https://github.com/flutter/packages/tree/main/packages/pigeon
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22
version: 22.6.2 # This must match the version in lib/generator_tools.dart
version: 22.6.3 # This must match the version in lib/generator_tools.dart

environment:
sdk: ^3.3.0
Expand Down

0 comments on commit d441566

Please sign in to comment.