[flutter_migrate] Replace deprecated APIs (#6128)

Updates package for `test_api` deprecation and deprecation of `runZoned`s `onError` parameter.

Fixes https://github.com/flutter/flutter/issues/143447
Fixes https://github.com/flutter/flutter/issues/143455
This commit is contained in:
stuartmorgan
2024-02-14 11:04:15 -08:00
committed by GitHub
parent b87b3ba610
commit db96f93c3e
4 changed files with 6 additions and 7 deletions

View File

@ -138,7 +138,7 @@ Future<T> asyncGuard<T>(
}
}
runZoned<void>(() async {
runZonedGuarded<void>(() async {
try {
final T result = await fn();
if (!completer.isCompleted) {
@ -150,7 +150,7 @@ Future<T> asyncGuard<T>(
// ignore: avoid_catches_without_on_clauses, forwards to Future
handleError(e, s);
}
}, onError: (Object e, StackTrace s) {
}, (Object e, StackTrace s) {
handleError(e, s);
});

View File

@ -24,4 +24,3 @@ dev_dependencies:
file_testing: 3.0.0
lints: ^2.0.0
test: ^1.16.0
test_api: ^0.4.13

View File

@ -10,12 +10,12 @@ import 'package:flutter_migrate/src/base/file_system.dart';
import 'package:flutter_migrate/src/base/io.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as path; // flutter_ignore: package_path_import
import 'package:test_api/test_api.dart' as test_package show test;
import 'package:test_api/test_api.dart' hide test;
import 'package:test/test.dart' as test_package show test;
import 'package:test/test.dart' hide test;
import 'test_utils.dart';
export 'package:test_api/test_api.dart' hide isInstanceOf, test;
export 'package:test/test.dart' hide isInstanceOf, test;
bool tryToDelete(FileSystemEntity fileEntity) {
// This should not be necessary, but it turns out that

View File

@ -5,7 +5,7 @@
import 'package:args/command_runner.dart';
import 'package:flutter_migrate/src/base/command.dart';
export 'package:test_api/test_api.dart' hide isInstanceOf, test;
export 'package:test/test.dart' hide isInstanceOf, test;
CommandRunner<void> createTestCommandRunner([MigrateCommand? command]) {
final CommandRunner<void> runner = TestCommandRunner();