Remove Cupertino UI branches
Keep the Material-only status, text, and scale paths while preserving public signatures and the Cupertino colors still required by the status API.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../features/chat/ui/transcript/chat_markdown_view.dart';
|
||||
import '../adaptive/host.dart';
|
||||
|
||||
/// Authored markdown (a pipeline's source, a stage's prompt) shown rendered,
|
||||
/// with a switch to the raw text.
|
||||
@@ -51,23 +49,15 @@ class MarkdownModeSwitch extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino = usesCupertinoHost(context);
|
||||
return cupertino
|
||||
? CupertinoSlidingSegmentedControl<bool>(
|
||||
key: const Key('markdown-source-mode'),
|
||||
groupValue: raw,
|
||||
onValueChanged: (value) => onChanged(value ?? false),
|
||||
children: const {false: Text('Rendered'), true: Text('Raw')},
|
||||
)
|
||||
: SegmentedButton<bool>(
|
||||
key: const Key('markdown-source-mode'),
|
||||
showSelectedIcon: false,
|
||||
segments: const [
|
||||
ButtonSegment(value: false, label: Text('Rendered')),
|
||||
ButtonSegment(value: true, label: Text('Raw')),
|
||||
],
|
||||
selected: {raw},
|
||||
onSelectionChanged: (value) => onChanged(value.single),
|
||||
);
|
||||
return SegmentedButton<bool>(
|
||||
key: const Key('markdown-source-mode'),
|
||||
showSelectedIcon: false,
|
||||
segments: const [
|
||||
ButtonSegment(value: false, label: Text('Rendered')),
|
||||
ButtonSegment(value: true, label: Text('Raw')),
|
||||
],
|
||||
selected: {raw},
|
||||
onSelectionChanged: (value) => onChanged(value.single),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user