Slide 20
Slide 20 text
8JEHFU5FTUΛॻ͍ͯΈΔ
void main() {
testWidgets('Add and remove a todo', (WidgetTester tester) async {
await tester.pumpWidget(TodoList());
// WidgetTesterܦ༝ͰΟδΣοτΛૢ࡞
await tester.enterText(find.byType(TextField), 'hi');
await tester.tap(find.byType(FloatingActionButton));
// ΟδΣοτΛϦϏϧυ
await tester.pump();
expect(find.text('hi'), findsOneWidget);
await tester.drag(find.byType(Dismissible), Offset(500.0, 0.0));
await tester.pumpAndSettle();
expect(find.text('hi'), findsNothing);
});
}
ࢀߟIUUQTqVUUFSEFWEPDTDPPLCPPLUFTUJOHXJEHFUJOUSPEVDUJPO