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. /// that anything was sent.
var _crashReporterReady = false; var _crashReporterReady = false;
@visibleForTesting
void debugSetCrashReporterReady(bool ready) => _crashReporterReady = ready;
/// Sends a persisted startup failure to the crash reporter, once. /// Sends a persisted startup failure to the crash reporter, once.
/// ///
/// Reporting cannot happen where the failure is caught. The gate opens /// 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.browserBack): const DismissIntent(),
const SingleActivator(LogicalKeyboardKey.gameButtonB): 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 /// 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 /// below would leave global snackbars at the car's native density while the rest of the
/// interface grew. /// interface grew.
Widget _rootShell(Widget? child) { Widget rootShell(Widget? child) {
return _FormFactorScale( return FormFactorScale(
child: ScaffoldMessenger( child: ScaffoldMessenger(
key: rootScaffoldMessengerKey, key: rootScaffoldMessengerKey,
child: Scaffold(backgroundColor: Colors.transparent, body: child), 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 /// report a very low display density. Both make otherwise comfortable controls
/// physically too small, so render through a smaller, self-consistent logical /// physically too small, so render through a smaller, self-consistent logical
/// viewport and scale the result back to the physical surface. /// viewport and scale the result back to the physical surface.
class _FormFactorScale extends StatelessWidget { class FormFactorScale extends StatelessWidget {
final Widget? child; final Widget? child;
const _FormFactorScale({required this.child}); const FormFactorScale({super.key, required this.child});
static const double _appleTvScale = 2.0; 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 @visibleForTesting
bool shouldBypassSetupForDatabaseRecovery(TvosDatabaseRecoveryOutcome outcome) { bool shouldBypassSetupForDatabaseRecovery(TvosDatabaseRecoveryOutcome outcome) {
return outcome == TvosDatabaseRecoveryOutcome.recoveryRequired; return outcome == TvosDatabaseRecoveryOutcome.recoveryRequired;
+2 -2
View File
@@ -43,7 +43,7 @@ void main() {
child: MaterialApp( child: MaterialApp(
theme: ThemeData(extensions: const [testMonoTokens]), theme: ThemeData(extensions: const [testMonoTokens]),
home: const SizedBox.expand(), 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( TranslationProvider(
child: MaterialApp( child: MaterialApp(
theme: ThemeData(extensions: const [testMonoTokens]), theme: ThemeData(extensions: const [testMonoTokens]),
home: app.formFactorScaleForTesting( home: app.FormFactorScale(
child: Builder( child: Builder(
builder: (context) { builder: (context) {
onMediaQuery(MediaQuery.of(context)); onMediaQuery(MediaQuery.of(context));