fix(ci): replace unused main.dart test wrappers with the public root shell

The unused-code gate flags debugSetCrashReporterReady (referenced nowhere)
and the formFactorScaleForTesting/rootShellForTesting wrappers (referenced
only from tests, which the lib-scoped check cannot see). Delete the dead
setter and let the car-scale test build the real rootShell and
FormFactorScale directly.
This commit is contained in:
edde746
2026-08-09 18:51:47 +02:00
parent df0570b861
commit 0ee5672426
2 changed files with 7 additions and 17 deletions
+5 -15
View File
@@ -350,9 +350,6 @@ StartupFailureRecord describeStartupFailure(Object error, StackTrace stackTrace)
/// that anything was sent.
var _crashReporterReady = false;
@visibleForTesting
void debugSetCrashReporterReady(bool ready) => _crashReporterReady = ready;
/// Sends a persisted startup failure to the crash reporter, once.
///
/// Reporting cannot happen where the failure is caught. The gate opens
@@ -1749,7 +1746,7 @@ class _AppShell extends StatelessWidget {
const SingleActivator(LogicalKeyboardKey.browserBack): const DismissIntent(),
const SingleActivator(LogicalKeyboardKey.gameButtonB): const DismissIntent(),
},
builder: (context, child) => _rootShell(child),
builder: (context, child) => rootShell(child),
),
),
);
@@ -1767,8 +1764,8 @@ class _AppShell extends StatelessWidget {
/// Flutter presents a messenger's snackbars on the rootmost registered scaffold, so anything
/// below would leave global snackbars at the car's native density while the rest of the
/// interface grew.
Widget _rootShell(Widget? child) {
return _FormFactorScale(
Widget rootShell(Widget? child) {
return FormFactorScale(
child: ScaffoldMessenger(
key: rootScaffoldMessengerKey,
child: Scaffold(backgroundColor: Colors.transparent, body: child),
@@ -1780,9 +1777,9 @@ Widget _rootShell(Widget? child) {
/// report a very low display density. Both make otherwise comfortable controls
/// physically too small, so render through a smaller, self-consistent logical
/// viewport and scale the result back to the physical surface.
class _FormFactorScale extends StatelessWidget {
class FormFactorScale extends StatelessWidget {
final Widget? child;
const _FormFactorScale({required this.child});
const FormFactorScale({super.key, required this.child});
static const double _appleTvScale = 2.0;
@@ -1848,13 +1845,6 @@ class _FormFactorScale extends StatelessWidget {
}
}
@visibleForTesting
Widget formFactorScaleForTesting({required Widget? child}) => _FormFactorScale(child: child);
/// The real root shell, so a test can assert what the scale actually encloses.
@visibleForTesting
Widget rootShellForTesting({required Widget? child}) => _rootShell(child);
@visibleForTesting
bool shouldBypassSetupForDatabaseRecovery(TvosDatabaseRecoveryOutcome outcome) {
return outcome == TvosDatabaseRecoveryOutcome.recoveryRequired;
+2 -2
View File
@@ -43,7 +43,7 @@ void main() {
child: MaterialApp(
theme: ThemeData(extensions: const [testMonoTokens]),
home: const SizedBox.expand(),
builder: (context, child) => app.rootShellForTesting(child: child),
builder: (context, child) => app.rootShell(child),
),
),
);
@@ -142,7 +142,7 @@ Future<void> _pumpScaleHarness(WidgetTester tester, {required ValueChanged<Media
TranslationProvider(
child: MaterialApp(
theme: ThemeData(extensions: const [testMonoTokens]),
home: app.formFactorScaleForTesting(
home: app.FormFactorScale(
child: Builder(
builder: (context) {
onMediaQuery(MediaQuery.of(context));