import 'package:flutter/material.dart'; import 'package:pipelines_app/features/pipelines/screen.dart'; import 'pipelines_probe_fixture.dart'; /// Browser fixture for the pipeline detail's real Graph tab. /// /// `dark=1` selects the dark theme and `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and /// definition pane are the same widgets the app registers; only the replies /// come from the in-memory fixture. void main() { final parameters = Uri.base.queryParameters; runApp( _PipelineGraphTabProbe( dark: parameters['dark'] == '1', scale: double.tryParse(parameters['scale'] ?? '') ?? 1, ), ); } class _PipelineGraphTabProbe extends StatelessWidget { const _PipelineGraphTabProbe({required this.dark, required this.scale}); final bool dark; final double scale; @override Widget build(BuildContext context) { Widget scaled(BuildContext context, Widget? child) => MediaQuery( data: MediaQuery.of( context, ).copyWith(textScaler: TextScaler.linear(scale)), child: child ?? const SizedBox.shrink(), ); final screen = PipelinesScreen( gateway: PipelinesProbeGateway(), embedded: true, ); return MaterialApp( title: 'Pipeline graph fixture', debugShowCheckedModeBanner: false, theme: ThemeData( platform: TargetPlatform.android, brightness: Brightness.light, ), darkTheme: ThemeData( platform: TargetPlatform.android, brightness: Brightness.dark, ), themeMode: dark ? ThemeMode.dark : ThemeMode.light, builder: scaled, home: Scaffold(body: SafeArea(child: screen)), ); } }