title: flutter test not finding widget
body: <p>I have this code that test if the button is on the screen:</p>
  <pre><code>void main() {
    testWidgets('Search for button', (WidgetTester tester) async {
      await tester.pumpWidget(MaterialApp(
        home: HomeView(),
      ));
      final button = find.byType(BotaoRedirecionamentoInterno);
      expect(button, findsWidgets);
    });
  }
  </code></pre>
  <p>Is working as I expected, but when I try this code that search for another type of button in the same view it doenst work:</p>
  <pre><code>void main() {
    testWidgets('Search for button', (WidgetTester tester) async {
      await tester.pumpWidget(MaterialApp(
        home: HomeView(),
      ));
      final button = find.byType(BotaoRedirecionamentoExterno);
      expect(button, findsWidgets);
    });
  }
  </code></pre>
  <p>I don't understand why because they are exactly one line below in the HomeView:</p>
  <pre><code>      Expanded(
          child: GridView.count(
            childAspectRatio: 6,
            padding: EdgeInsets.only(left: screenWidth * .05, right: screenWidth * .05),
            mainAxisSpacing: screenHeight * 0.02,
            crossAxisCount: 1,
            children: const [
              BotaoRedirecionamentoInterno(texto: &quot;aaa&quot;, rota: '/bbbb'),
              BotaoRedirecionamentoExterno(texto: 'aaa', url: &quot;bbb&quot;),
              BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: &quot;bbb&quot;),
              BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: &quot;bbb&quot;),
              BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: 'bbb'),
              BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: &quot;bbb&quot;),
            ],
          ),
        )
  </code></pre>
  <p>this is the error message :</p>
  <pre><code>══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
  The following TestFailure object was thrown running a test:
    Expected: at least one matching node in the widget tree
    Actual: _WidgetTypeFinder:&lt;zero widgets with type &quot;BotaoRedirecionamentoExterno&quot; (ignoring
  offstage widgets)&gt;
  </code></pre>
  <p>I discovered that if I change the position inside the GridView to this:</p>
  <pre><code> Expanded(
              child: GridView.count(
                childAspectRatio: 6,
                padding: EdgeInsets.only(left: screenWidth * .05, right: screenWidth * .05),
                mainAxisSpacing: screenHeight * 0.02,
                crossAxisCount: 1,
                children: const [
                  BotaoRedirecionamentoExterno(texto: 'aaa', url: &quot;bbb&quot;),
                  BotaoRedirecionamentoInterno(texto: &quot;aaa&quot;, rota: '/bbbb'),
  
                  BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: &quot;bbb&quot;),
                  BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: &quot;bbb&quot;),
                  BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: 'bbb'),
                  BotaoRedirecionamentoExterno(texto: &quot;aaa&quot;, url: &quot;bbb&quot;),
                ],
              ),
            )
  </code></pre>
  <p>The test finds the BotaoRedirecionamentoInterno but wont find BotaoRedirecionamentoExterno, so my guess is that is only finding the first widget inside the GridView.</p>
  <p>Anyone could help me figure out what is happening ?</p>