Repository: flutter
Issue: Widget test giving false warning about TabBar
Labels: a: tests,framework,a: error message,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-framework,triaged-framework

## Description

I was trying to write tests to test for a `TabBar`. I made the widget tester to tap on one of the tabs and check if the tab bar view widget is rendered correctly. Everything works as expected except that I'm getting a warning which I think might be a false positive.

## Steps to Reproduce


<details>
  <summary>main.dart</summary>
  
  ```dart
  import 'package:flutter/material.dart';

  void main() {
    runApp(const TabBarDemo());
  }

  class TabBarDemo extends StatelessWidget {
    const TabBarDemo({Key? key}) : super(key: key);

    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: DefaultTabController(
          length: 3,
          child: Scaffold(
            appBar: AppBar(
              bottom: const TabBar(
                tabs: [
                  Tab(icon: Icon(Icons.directions_car), text: 'Car'),
                  Tab(icon: Icon(Icons.directions_transit), text: 'Transit'),
                  Tab(icon: Icon(Icons.directions_bike), text: 'Bike'),
                ],
              ),
              title: const Text('Tabs Demo'),
            ),
            body: const TabBarView(
              children: [
                Text('Car View'),
                Text('Transit View'),
                Text('Bike View'),
              ],
            ),
          ),
        ),
      );
    }
  }
  ```
</details>

<details>
  <summary>widget_test.dart</summary>
  
  ```dart
  import 'package:flutter/material.dart';
  import 'package:flutter_test/flutter_test.dart';

  import 'package:tab_bar_app/main.dart';

  void main() {
    testWidgets('tab bar', (WidgetTester tester) async {
      await tester.pumpWidget(TabBarDemo());

      await tester.tap(find.byWidgetPredicate((widget) {
        return widget is Tab && widget.text == 'Transit';
      }));
      await tester.pumpAndSettle();

      expect(find.text('Transit View'), findsOneWidget);
      expect(find.text('Car View'), findsNothing);
    });
  }
  ```
</details>

**Expected results:** <!-- what did you want to see? -->

The test should pass without any warnings

**Actual results:** <!-- what did you see? -->

The test passed but with the following warning:

```
Warning: A call to tap() with finder "exactly one widget with widget matching predicate (Closure: (Widget) => bool): Tab(text: "Transit", icon: Icon)" derived an Offset (Offset(400.0, 92.0)) that would not hit test on the specified widget.
Maybe the widget is actually off-screen, or another widget is obscuring it, or the widget cannot receive pointer events.
The finder corresponds to this RenderBox: RenderConstrainedBox#228e2 relayoutBoundary=up20
The hit test result at that offset is: HitTestResult(RenderPointerListener#f2668@Offset(133.3, 36.0), RenderSemanticsAnnotations#0e498@Offset(133.3, 36.0), RenderMouseRegion#d637f@Offset(133.3, 36.0), RenderSemanticsAnnotations#7980a@Offset(133.3, 36.0), _TabLabelBarRenderer#fff7b@Offset(400.0, 36.0), RenderCustomPaint#a8eeb@Offset(400.0, 36.0), RenderFlex#47b4f@Offset(400.0, 92.0), RenderPadding#bb66e@Offset(400.0, 92.0), RenderPositionedBox#dfd34@Offset(400.0, 92.0), RenderSemanticsAnnotations#46740@Offset(400.0, 92.0), _RenderInkFeatures#9b056@Offset(400.0, 92.0), RenderPhysicalModel#e4baa@Offset(400.0, 92.0), RenderAnnotatedRegion<SystemUiOverlayStyle>#55351@Offset(400.0, 92.0), RenderSemanticsAnnotations#523ce@Offset(400.0, 92.0), RenderConstrainedBox#13ab3@Offset(400.0, 92.0), RenderCustomMultiChildLayoutBox#4b0a2@Offset(400.0, 92.0), _RenderInkFeatures#36480@Offset(400.0, 92.0), RenderPhysicalModel#70caa@Offset(400.0, 92.0), RenderSemanticsAnnotations#7cc8a@Offset(400.0, 92.0), RenderRepaintBoundary#23ef4@Offset(400.0, 92.0), RenderIgnorePointer#0fd76@Offset(400.0, 92.0), RenderAnimatedOpacity#769e4@Offset(400.0, 92.0), RenderRepaintBoundary#0364b@Offset(400.0, 92.0), RenderSemanticsAnnotations#d8bee@Offset(400.0, 92.0), RenderOffstage#ae5b8@Offset(400.0, 92.0), RenderSemanticsAnnotations#fa795@Offset(400.0, 92.0), _RenderTheatre#3b565@Offset(400.0, 92.0), RenderSemanticsAnnotations#a4128@Offset(400.0, 92.0), RenderAbsorbPointer#2d455@Offset(400.0, 92.0), RenderPointerListener#595c0@Offset(400.0, 92.0), RenderCustomPaint#13c8b@Offset(400.0, 92.0), RenderSemanticsAnnotations#a29f9@Offset(400.0, 92.0), RenderSemanticsAnnotations#2c00e@Offset(400.0, 92.0), RenderSemanticsAnnotations#6815f@Offset(400.0, 92.0), HitTestEntry#47654(RenderView#e7259), HitTestEntry#42376(<AutomatedTestWidgetsFlutterBinding>))
```

<details>
  <summary>Logs</summary>

### Analyze
```
No issues found! (ran in 4.7s)
```

### Doctor
```
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-x64, locale en-AU)
    • Flutter version 2.2.3 at <scrubbed>
    • Framework revision f4abaa0735 (2 months ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at <scrubbed>
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = <scrubbed>
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.60.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.26.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 11.5.2 20G95 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 93.0.4577.63

• No issues found!
```

</details>