Merge: Material host and controls on every platform

This commit is contained in:
2026-11-03 16:08:08 +00:00
13 changed files with 139 additions and 130 deletions
@@ -5,18 +5,13 @@ import 'package:flutter/material.dart';
/// Which standard control family this screen renders.
enum ChatControlsStyle { material, cupertino }
/// Cupertino under a Cupertino app or an iOS/macOS Material theme, Material
/// everywhere else. The shell decides the app class, so a bare Cupertino app
/// never has to grow a Material ancestor just for this screen.
ChatControlsStyle chatControlsStyleOf(BuildContext context) {
if (context.findAncestorWidgetOfExactType<MaterialApp>() == null) {
return ChatControlsStyle.cupertino;
}
final platform = Theme.of(context).platform;
return platform == TargetPlatform.iOS || platform == TargetPlatform.macOS
? ChatControlsStyle.cupertino
: ChatControlsStyle.material;
}
/// Cupertino under an explicit Cupertino app, Material everywhere else,
/// whatever the target platform. The shell decides the app class, so a bare
/// Cupertino app never has to grow a Material ancestor just for this screen.
ChatControlsStyle chatControlsStyleOf(BuildContext context) =>
context.findAncestorWidgetOfExactType<MaterialApp>() == null
? ChatControlsStyle.cupertino
: ChatControlsStyle.material;
class ChatBarAction extends StatelessWidget {
const ChatBarAction({
@@ -100,7 +100,7 @@ class _ChatAttachmentThumbnailState extends State<ChatAttachmentThumbnail> {
child: Center(
child: widget.cupertino
? const CupertinoActivityIndicator()
: const CircularProgressIndicator.adaptive(),
: const CircularProgressIndicator(),
),
);