mirror of
https://github.com/flutter/packages.git
synced 2025-07-03 17:18:22 +08:00
[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:
@ -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);
|
||||
});
|
||||
|
||||
|
@ -24,4 +24,3 @@ dev_dependencies:
|
||||
file_testing: 3.0.0
|
||||
lints: ^2.0.0
|
||||
test: ^1.16.0
|
||||
test_api: ^0.4.13
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user