Skip to content

Commit db96f93

Browse files
[flutter_migrate] Replace deprecated APIs (#6128)
Updates package for `test_api` deprecation and deprecation of `runZoned`s `onError` parameter. Fixes flutter/flutter#143447 Fixes flutter/flutter#143455
1 parent b87b3ba commit db96f93

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

packages/flutter_migrate/lib/src/base/common.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Future<T> asyncGuard<T>(
138138
}
139139
}
140140

141-
runZoned<void>(() async {
141+
runZonedGuarded<void>(() async {
142142
try {
143143
final T result = await fn();
144144
if (!completer.isCompleted) {
@@ -150,7 +150,7 @@ Future<T> asyncGuard<T>(
150150
// ignore: avoid_catches_without_on_clauses, forwards to Future
151151
handleError(e, s);
152152
}
153-
}, onError: (Object e, StackTrace s) {
153+
}, (Object e, StackTrace s) {
154154
handleError(e, s);
155155
});
156156

packages/flutter_migrate/pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ dev_dependencies:
2424
file_testing: 3.0.0
2525
lints: ^2.0.0
2626
test: ^1.16.0
27-
test_api: ^0.4.13

packages/flutter_migrate/test/src/common.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import 'package:flutter_migrate/src/base/file_system.dart';
1010
import 'package:flutter_migrate/src/base/io.dart';
1111
import 'package:meta/meta.dart';
1212
import 'package:path/path.dart' as path; // flutter_ignore: package_path_import
13-
import 'package:test_api/test_api.dart' as test_package show test;
14-
import 'package:test_api/test_api.dart' hide test;
13+
import 'package:test/test.dart' as test_package show test;
14+
import 'package:test/test.dart' hide test;
1515

1616
import 'test_utils.dart';
1717

18-
export 'package:test_api/test_api.dart' hide isInstanceOf, test;
18+
export 'package:test/test.dart' hide isInstanceOf, test;
1919

2020
bool tryToDelete(FileSystemEntity fileEntity) {
2121
// This should not be necessary, but it turns out that

packages/flutter_migrate/test/src/test_flutter_command_runner.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import 'package:args/command_runner.dart';
66
import 'package:flutter_migrate/src/base/command.dart';
77

8-
export 'package:test_api/test_api.dart' hide isInstanceOf, test;
8+
export 'package:test/test.dart' hide isInstanceOf, test;
99

1010
CommandRunner<void> createTestCommandRunner([MigrateCommand? command]) {
1111
final CommandRunner<void> runner = TestCommandRunner();

0 commit comments

Comments
 (0)