import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/features/chat/session_screen.dart'; class _FixtureGateway implements ApiGateway { @override Stream get frames => const Stream.empty(); @override Future call(String type, [JsonMap fields = const {}]) async { if (type == 'chat_sessions') { return { 'chat_sessions': [ { 'id': 'probe-open', 'title': 'Open fixture', 'directory': '/workspace/demo', 'starred': true, }, { 'id': 'probe-closed', 'title': 'Closed fixture', 'directory': '/workspace/archive', 'closed_at': '2026-01-01', }, { 'id': 'probe-stream', 'title': 'Streaming fixture', 'directory': '/workspace/demo', 'running': true, }, ], }; } if (type == 'chat_directories') { return { 'chat_directories': ['/workspace/demo', '/workspace/archive'], }; } if (type == 'chat_backends') { return { 'chat_backends': ['opencode', 'codex'], }; } if (type == 'chat_create') { return { 'chat_session': { 'id': 'probe-new', 'title': 'New fixture', 'directory': '/workspace/demo', }, }; } return {'chat_session': {}}; } } const _probeStyle = String.fromEnvironment( 'CHAT_PROBE_STYLE', defaultValue: 'material', ); void main() { final home = ChatSessionsScreen(gateway: _FixtureGateway(), onOpen: (_) {}); if (_probeStyle == 'cupertino') { runApp(CupertinoApp(home: home)); return; } runApp( MaterialApp( theme: ThemeData(platform: TargetPlatform.android), home: home, ), ); }