Remove Cupertino fixture alternatives
Keep capture and probe tooling on the app's single Material surface by removing obsolete platform switches, hosts, and documentation. Preserve the existing Material routes and fixture behavior while retaining compatibility APIs outside this lane.
This commit is contained in:
@@ -1,56 +1,34 @@
|
||||
// Web-only fixture entrypoint for rendered search evidence. It is not part of
|
||||
// the application's `main.dart`; build it explicitly with:
|
||||
// flutter build web -t tool/search_fixture/main.dart
|
||||
// `?cupertino=1` renders the same screen inside a CupertinoApp.
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/search/search_screen.dart';
|
||||
|
||||
void main() {
|
||||
final cupertino = Uri.base.queryParameters['cupertino'] == '1';
|
||||
runApp(
|
||||
cupertino
|
||||
? const CupertinoApp(
|
||||
title: 'Search fixture',
|
||||
home: _FixtureHost(cupertino: true),
|
||||
)
|
||||
: const MaterialApp(
|
||||
title: 'Search fixture',
|
||||
home: _FixtureHost(cupertino: false),
|
||||
),
|
||||
);
|
||||
runApp(const MaterialApp(title: 'Search fixture', home: _FixtureHost()));
|
||||
}
|
||||
|
||||
class _FixtureHost extends StatelessWidget {
|
||||
const _FixtureHost({required this.cupertino});
|
||||
|
||||
final bool cupertino;
|
||||
const _FixtureHost();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SearchScreen(
|
||||
gateway: const _FixtureGateway(),
|
||||
cupertino: cupertino,
|
||||
onOpen: (hit) {
|
||||
final route = cupertino
|
||||
? CupertinoPageRoute<void>(
|
||||
builder: (_) => _Opened(hit: hit, cupertino: true),
|
||||
)
|
||||
: MaterialPageRoute<void>(
|
||||
builder: (_) => _Opened(hit: hit, cupertino: false),
|
||||
);
|
||||
Navigator.of(context).push(route);
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute<void>(builder: (_) => _Opened(hit: hit)),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class _Opened extends StatelessWidget {
|
||||
const _Opened({required this.hit, required this.cupertino});
|
||||
const _Opened({required this.hit});
|
||||
|
||||
final JsonMap hit;
|
||||
final bool cupertino;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -63,12 +41,6 @@ class _Opened extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
);
|
||||
if (cupertino) {
|
||||
return CupertinoPageScaffold(
|
||||
navigationBar: const CupertinoNavigationBar(middle: Text('Opened')),
|
||||
child: body,
|
||||
);
|
||||
}
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Opened')),
|
||||
body: body,
|
||||
|
||||
Reference in New Issue
Block a user