Skip to content

Instantly share code, notes, and snippets.

View Thithip's full-sized avatar
🦙

Thibaut Pierret Thithip

🦙
View GitHub Profile
@KoalityJustin
KoalityJustin / main.dart
Last active December 26, 2023 06:01
All You Need
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
extension TestingHelpers on WidgetTester {
/// Helper method for tapping a finder, and for optionally choosing the index
/// if the finder finds multiple and if we should scroll to before tapping.
Future<void> tapFinder(
Finder finder, {
extension on WidgetTester {
Future<void> launchApp() async {
await app.main();
await pumpAndSettle();
}
Future<void> clearState() async {
await SharedPreferences.getInstance().then((it) => it.clear());
}