Shuffle/app/test/core/widgets/widget_harness.dart
cschlaefke ec8b2ab4c1 feat(ui): add auth form components and screen layouts
Refs #1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 00:03:11 +01:00

32 lines
802 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import '../../helpers/pump_app.dart';
/// Pumps [child] in a scrollable Scaffold with the app theme.
Future<void> pumpWidgetUnderTest(
WidgetTester tester,
Widget child, {
ThemeMode themeMode = ThemeMode.light,
double? textScale,
Size size = const Size(400, 800),
bool settle = true,
}) async {
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
await pumpApp(
tester,
themeMode: themeMode,
textScale: textScale,
settle: settle,
home: Scaffold(
body: SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: child,
),
),
);
}
const themeModes = [ThemeMode.light, ThemeMode.dark];