Skip to content

Instantly share code, notes, and snippets.

@tianhaoz95
Created October 24, 2019 03:45
Show Gist options
  • Save tianhaoz95/0ca8927b80c32854c239183f856fe82e to your computer and use it in GitHub Desktop.
Save tianhaoz95/0ca8927b80c32854c239183f856fe82e to your computer and use it in GitHub Desktop.
Test incrementing click count
testWidgets('Counter increments', (WidgetTester tester) async {
await tester.pumpWidget(MyApp());
expect(find.text('0'), findsOneWidget);
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
expect(find.text('1'), findsOneWidget);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment