feat(app): add run change captures and native diff viewer

This commit is contained in:
2026-10-21 18:26:53 +01:00
parent 160ab45fe0
commit 15cca17aa4
25 changed files with 4658 additions and 0 deletions
@@ -0,0 +1,41 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
/// The two platform hosts the Changes widget tests share: Material for
/// Android/desktop/web and Cupertino for iOS/macOS. They state the platform
/// explicitly instead of mutating a global debug override.
Widget materialHost(
Widget child, {
TextScaler scaler = TextScaler.noScaling,
Brightness brightness = Brightness.light,
}) {
return MaterialApp(
theme: ThemeData(brightness: brightness),
builder: (context, app) => MediaQuery(
data: MediaQuery.of(context).copyWith(textScaler: scaler),
child: app!,
),
home: Scaffold(body: child),
);
}
Widget cupertinoHost(
Widget child, {
TextScaler scaler = TextScaler.noScaling,
Brightness brightness = Brightness.light,
}) {
return CupertinoApp(
theme: CupertinoThemeData(brightness: brightness),
builder: (context, app) => Theme(
// The real app selects Cupertino by platform; the test host states it
// explicitly without changing a global debug override. The Theme wraps
// the Navigator so dialogs opened later resolve the same platform.
data: ThemeData(platform: TargetPlatform.iOS),
child: MediaQuery(
data: MediaQuery.of(context).copyWith(textScaler: scaler),
child: app!,
),
),
home: CupertinoPageScaffold(child: SafeArea(child: child)),
);
}