Estou fazendo igual ao curso mas sempre retorna erro mesmo se for o findsNothing ou o findsOneWidget, qual seria o motivo desse erro ?
import 'package:flutter_test/flutter_test.dart';
import 'package:banco/screens/dashboard.dart';
import 'package:flutter/material.dart';
void main() {
testWidgets('Imagem Dashboard', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: Dashboard()));
final mainImage = find.byType(Image);
expect(mainImage, findsOneWidget);
});
}
O Erro Retorna assim
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during layout:
A RenderFlex overflowed by 14 pixels on the bottom.
The relevant error-causing widget was:
Column
file:///F:/Heron/Flutter/APP-Flutter-Curso-Alura/Curso%202/banco/lib/screens/dashboard.dart:79:20
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the
RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be
seen. If the content is legitimately bigger than the available space, consider clipping it with a
ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex,
like a ListView.
The specific RenderFlex in question is: RenderFlex#f009b OVERFLOWING:
creator: Column ← Padding ← ConstrainedBox ← Container ← _PointerListener ← Listener ←
_GestureSemantics ← RawGestureDetector ← GestureDetector ← _RawMouseRegion ← MouseRegion ←
Semantics ← ⋯
parentData: offset=Offset(8.0, 8.0) (can use size)
constraints: BoxConstraints(w=84.0, h=58.0)
size: Size(84.0, 58.0)
direction: vertical
mainAxisAlignment: spaceBetween
mainAxisSize: max
crossAxisAlignment: start
textDirection: ltr
verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
════════════════════════════════════════════════════════════════════════════════════════════════════
Test failed. See exception logs above.
The test description was: Imagem Dashboard