214bbbc54f
Keep the existing Material terminal and chat-shell behavior while removing live Cupertino widgets, icon metadata, and alternate-host branches. Retain only the documented optional compatibility parameters until remaining callers migrate.
62 lines
1.8 KiB
Dart
62 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../conversation/chat_card_styles.dart';
|
|
import 'chat_shell_run.dart';
|
|
import 'chat_shell_runs_controller.dart';
|
|
import 'chat_shell_terminal_keys.dart';
|
|
import 'chat_shell_terminal_view.dart';
|
|
|
|
/// The output area of one command card: the run's terminal emulator, which
|
|
/// takes typing while the command runs (with the key toolbar below it), or
|
|
/// its retained output read-only once it ended.
|
|
class ChatShellOutputView extends StatelessWidget {
|
|
const ChatShellOutputView({
|
|
super.key,
|
|
required this.run,
|
|
required this.controller,
|
|
required this.viewKey,
|
|
required this.fullScreen,
|
|
});
|
|
|
|
final ChatShellRun run;
|
|
final ChatShellRunsController controller;
|
|
|
|
/// Replaced when the full-screen view closes, so the card's view sizes the
|
|
/// terminal to itself again.
|
|
final Key viewKey;
|
|
|
|
/// True while the full-screen view sizes the terminal.
|
|
final bool fullScreen;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (!run.running && run.output.isEmpty) {
|
|
return Text(
|
|
'No output.',
|
|
key: const Key('chat-shell-output-empty'),
|
|
style: chatCardSecondaryStyle(context, false),
|
|
);
|
|
}
|
|
final session = controller.terminals.session(run);
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
ChatShellTerminalView(
|
|
key: viewKey,
|
|
session: session,
|
|
autoResize: !fullScreen,
|
|
),
|
|
if (session.live && !fullScreen)
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 8),
|
|
child: ChatShellTerminalKeys(
|
|
session: session,
|
|
field: chatShellTouchFirst(),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|