Search code examples
flutterunit-testingpackage

error importing flutter_test / test_api packages


I'm stocked in a problem related to test_api package. When In run my flutter app, I have this errors.

/Applications/flutter/packages/flutter_test/lib/src/_goldens_io.dart:12:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/expect.dart': No such file or directory
import 'package:test_api/expect.dart' show fail;
       ^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:17:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/expect.dart': No such file or directory
import 'package:test_api/expect.dart' show fail;
       ^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:10:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/src/expect/async_matcher.dart': No such file or directory
import 'package:test_api/src/expect/async_matcher.dart'; // ignore: implementation_imports
       ^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:13:8: Error: Error when reading '../../../.pub-cache/hosted/pub.dev/test_api-0.6.1/lib/src/expect/async_matcher.dart': No such file or directory
import 'package:test_api/src/expect/async_matcher.dart'; // ignore: implementation_imports
       ^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:44:33: Error: Type 'AsyncMatcher' not found.
class MatchesGoldenFile extends AsyncMatcher {
                                ^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:120:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:120:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:39:7: Error: Type 'Matcher' not found.
const Matcher findsNothing = _FindsWidgetMatcher(null, 0);
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:55:7: Error: Type 'Matcher' not found.
const Matcher findsWidgets = _FindsWidgetMatcher(1, null);
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:71:7: Error: Type 'Matcher' not found.
const Matcher findsOneWidget = _FindsWidgetMatcher(1, 1);
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:87:1: Error: Type 'Matcher' not found.
Matcher findsNWidgets(int n) => _FindsWidgetMatcher(n, n);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:103:1: Error: Type 'Matcher' not found.
Matcher findsAtLeastNWidgets(int n) => _FindsWidgetMatcher(n, null);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:120:7: Error: Type 'Matcher' not found.
const Matcher isOffstage = _IsOffstage();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:128:7: Error: Type 'Matcher' not found.
const Matcher isOnstage = _IsOnstage();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:136:7: Error: Type 'Matcher' not found.
const Matcher isInCard = _IsInCard();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:146:7: Error: Type 'Matcher' not found.
const Matcher isNotInCard = _IsNotInCard();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:152:1: Error: Type 'Matcher' not found.
Matcher isSameColorAs(Color color) => _ColorMatcher(targetColor: color);
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:159:7: Error: Type 'Matcher' not found.
const Matcher hasOneLineDescription = _HasOneLineDescription();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:176:7: Error: Type 'Matcher' not found.
const Matcher hasAGoodToStringDeep = _HasGoodToStringDeep();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:190:7: Error: Type 'Matcher' not found.
final Matcher throwsFlutterError = throwsA(isFlutterError);
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:205:7: Error: Type 'Matcher' not found.
final Matcher throwsAssertionError = throwsA(isAssertionError);
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:215:7: Error: Type 'TypeMatcher' not found.
final TypeMatcher<FlutterError> isFlutterError = isA<FlutterError>();
      ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:225:7: Error: Type 'TypeMatcher' not found.
final TypeMatcher<AssertionError> isAssertionError = isA<AssertionError>();
      ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:230:1: Error: Type 'TypeMatcher' not found.
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:251:1: Error: Type 'Matcher' not found.
Matcher moreOrLessEquals(double value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:265:1: Error: Type 'Matcher' not found.
Matcher rectMoreOrLessEquals(Rect value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:277:1: Error: Type 'Matcher' not found.
Matcher matrixMoreOrLessEquals(Matrix4 value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:291:1: Error: Type 'Matcher' not found.
Matcher offsetMoreOrLessEquals(Offset value, { double epsilon = precisionErrorTolerance }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:311:1: Error: Type 'Matcher' not found.
Matcher equalsIgnoringHashCodes(Object value) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:320:1: Error: Type 'Matcher' not found.
Matcher isMethodCall(String name, { required dynamic arguments }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:333:1: Error: Type 'Matcher' not found.
Matcher coversSameAreaAs(Path expectedPath, { required Rect areaToCompare, int sampleSize = 20 })
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:455:1: Error: Type 'AsyncMatcher' not found.
AsyncMatcher matchesGoldenFile(Object key, {int? version}) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:496:1: Error: Type 'AsyncMatcher' not found.
AsyncMatcher matchesReferenceImage(ui.Image image) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:522:1: Error: Type 'Matcher' not found.
Matcher matchesSemantics({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:595:8: Error: Type 'Matcher' not found.
  List<Matcher>? children,
       ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:695:1: Error: Type 'Matcher' not found.
Matcher containsSemantics({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:768:8: Error: Type 'Matcher' not found.
  List<Matcher>? children,
       ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:867:1: Error: Type 'AsyncMatcher' not found.
AsyncMatcher meetsGuideline(AccessibilityGuideline guideline) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:875:1: Error: Type 'AsyncMatcher' not found.
AsyncMatcher doesNotMeetGuideline(AccessibilityGuideline guideline) {
^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:879:35: Error: Type 'Matcher' not found.
class _FindsWidgetMatcher extends Matcher {
                                  ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:912:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:912:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:939:3: Error: Type 'Description' not found.
  Description describeMismatch(
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:941:5: Error: Type 'Description' not found.
    Description mismatchDescription,
    ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:988:27: Error: Type 'Matcher' not found.
class _IsOffstage extends Matcher {
                          ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1002:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('offstage');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1002:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('offstage');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1005:26: Error: Type 'Matcher' not found.
class _IsOnstage extends Matcher {
                         ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1027:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('onstage');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1027:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('onstage');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1030:25: Error: Type 'Matcher' not found.
class _IsInCard extends Matcher {
                        ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1037:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('in card');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1037:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('in card');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1040:28: Error: Type 'Matcher' not found.
class _IsNotInCard extends Matcher {
                           ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1047:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('not in card');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1047:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('not in card');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1050:38: Error: Type 'Matcher' not found.
class _HasOneLineDescription extends Matcher {
                                     ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1063:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('one line description');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1063:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('one line description');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1066:40: Error: Type 'Matcher' not found.
class _EqualsIgnoringHashCodes extends Matcher {
                                       ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1100:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1100:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1108:3: Error: Type 'Description' not found.
  Description describeMismatch(
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1110:5: Error: Type 'Description' not found.
    Description mismatchDescription,
    ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1157:36: Error: Type 'Matcher' not found.
class _HasGoodToStringDeep extends Matcher {
                                   ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1250:3: Error: Type 'Description' not found.
  Description describeMismatch(
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1252:5: Error: Type 'Description' not found.
    Description mismatchDescription,
    ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1263:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1263:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1380:1: Error: Type 'Matcher' not found.
Matcher within<T>({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1398:36: Error: Type 'Matcher' not found.
class _IsWithinDistance<T> extends Matcher {
                                   ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1426:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('$value (±$epsilon)');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1426:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('$value (±$epsilon)');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1429:3: Error: Type 'Description' not found.
  Description describeMismatch(
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1431:5: Error: Type 'Description' not found.
    Description mismatchDescription,
    ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1440:33: Error: Type 'Matcher' not found.
class _MoreOrLessEquals extends Matcher {
                                ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1459:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('$value (±$epsilon)');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1459:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('$value (±$epsilon)');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1462:3: Error: Type 'Description' not found.
  Description describeMismatch(dynamic item, Description mismatchDescription, Map<dynamic, dynamic> matchState, bool verbose) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1462:46: Error: Type 'Description' not found.
  Description describeMismatch(dynamic item, Description mismatchDescription, Map<dynamic, dynamic> matchState, bool verbose) {
                                             ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1468:29: Error: Type 'Matcher' not found.
class _IsMethodCall extends Matcher {
                            ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1523:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1523:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1533:7: Error: Type 'Matcher' not found.
const Matcher clipsWithBoundingRect = _ClipsWithBoundingRect();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1538:7: Error: Type 'Matcher' not found.
const Matcher hasNoImmediateClip = _MatchAnythingExceptClip();
      ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1543:1: Error: Type 'Matcher' not found.
Matcher clipsWithBoundingRRect({ required BorderRadius borderRadius }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1550:1: Error: Type 'Matcher' not found.
Matcher clipsWithShapeBorder({ required ShapeBorder shape }) {
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1571:1: Error: Type 'Matcher' not found.
Matcher rendersOnPhysicalModel({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1588:1: Error: Type 'Matcher' not found.
Matcher rendersOnPhysicalShape({
^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1598:52: Error: Type 'Matcher' not found.
abstract class _FailWithDescriptionMatcher extends Matcher {
                                                   ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1607:3: Error: Type 'Description' not found.
  Description describeMismatch(
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1609:5: Error: Type 'Description' not found.
    Description mismatchDescription,
    ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1640:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1640:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1748:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1748:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1796:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1796:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1833:3: Error: Type 'Description' not found.
  Description describe(Description description) =>
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1833:24: Error: Type 'Description' not found.
  Description describe(Description description) =>
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1873:3: Error: Type 'Description' not found.
  Description describe(Description description) =>
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1873:24: Error: Type 'Description' not found.
  Description describe(Description description) =>
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1901:3: Error: Type 'Description' not found.
  Description describe(Description description) =>
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1901:24: Error: Type 'Description' not found.
  Description describe(Description description) =>
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1905:33: Error: Type 'Matcher' not found.
class _CoversSameAreaAs extends Matcher {
                                ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1967:3: Error: Type 'Description' not found.
  Description describeMismatch(
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1969:5: Error: Type 'Description' not found.
    Description mismatchDescription,
    ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1977:3: Error: Type 'Description' not found.
  Description describe(Description description) =>
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1977:24: Error: Type 'Description' not found.
  Description describe(Description description) =>
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1981:29: Error: Type 'Matcher' not found.
class _ColorMatcher extends Matcher {
                            ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1997:3: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('matches color $targetColor');
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:1997:24: Error: Type 'Description' not found.
  Description describe(Description description) => description.add('matches color $targetColor');
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2014:38: Error: Type 'AsyncMatcher' not found.
class _MatchesReferenceImage extends AsyncMatcher {
                                     ^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2063:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2063:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2068:37: Error: Type 'Matcher' not found.
class _MatchesSemanticsData extends Matcher {
                                    ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2224:14: Error: Type 'Matcher' not found.
  final List<Matcher>? children;
             ^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2235:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2235:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2525:3: Error: Type 'Description' not found.
  Description describeMismatch(
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2527:5: Error: Type 'Description' not found.
    Description mismatchDescription,
    ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2540:46: Error: Type 'AsyncMatcher' not found.
class _MatchesAccessibilityGuideline extends AsyncMatcher {
                                             ^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2546:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2546:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2560:51: Error: Type 'AsyncMatcher' not found.
class _DoesNotMatchAccessibilityGuideline extends AsyncMatcher {
                                                  ^^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2566:3: Error: Type 'Description' not found.
  Description describe(Description description) {
  ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:2566:24: Error: Type 'Description' not found.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/_goldens_io.dart:120:7: Error: The method 'fail' isn't defined for the class 'LocalFileComparator'.
 - 'LocalFileComparator' is from 'package:flutter_test/src/_goldens_io.dart' ('/Applications/flutter/packages/flutter_test/lib/src/_goldens_io.dart').
Try correcting the name to the name of an existing method, or defining a method named 'fail'.
      fail(
      ^^^^
/Applications/flutter/packages/flutter_test/lib/src/_matchers_io.dart:120:24: Error: 'Description' isn't a type.
  Description describe(Description description) {
                       ^^^^^^^^^^^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1252:7: Error: The method 'fail' isn't defined for the class 'AutomatedTestWidgetsFlutterBinding'.
 - 'AutomatedTestWidgetsFlutterBinding' is from 'package:flutter_test/src/binding.dart' ('/Applications/flutter/packages/flutter_test/lib/src/binding.dart').
Try correcting the name to the name of an existing method, or defining a method named 'fail'.
      fail(
      ^^^^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1258:6: Error: A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
    }());
     ^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1897:7: Error: The method 'fail' isn't defined for the class 'LiveTestWidgetsFlutterBinding'.
 - 'LiveTestWidgetsFlutterBinding' is from 'package:flutter_test/src/binding.dart' ('/Applications/flutter/packages/flutter_test/lib/src/binding.dart').
Try correcting the name to the name of an existing method, or defining a method named 'fail'.
      fail(
      ^^^^
/Applications/flutter/packages/flutter_test/lib/src/binding.dart:1903:6: Error: A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't.
    }());
     ^
/Applications/flutter/packages/flutter_test/lib/src/matchers.dart:39:7: Error: 'Matcher' isn't a type.
const Matcher findsNothing = _FindsWidgetMatcher(null, 0);
      ^^^^^^^
                        ^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/Applications/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1201

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRecDebug'.
> Process 'command '/Applications/flutter/bin/flutter'' finished with non-zero exit value 1

so that means it doesn't found flutter_test packages as I understand.

I have tried to delete pubspec.lock, flutter clean and pub get,
I have tried flutter pub cache repair and flutter pub cache clean. I have tried to delete the folder located in .pub-cache/hosted/pub.dev but nothing works. always the same error

Could you please help me with to fix this problem?

Thanks in advance


Solution

  • add this to your pubspec.yaml

    dependency_overrides: test_api: 0.4.18