87a568a7b4
Keep the chat transcript and toolbar on their existing Material behavior while removing obsolete Cupertino-only helpers, arguments, and icon metadata. Preserve compatibility parameters where callers outside this lane still require them.
26 lines
1.0 KiB
Dart
26 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'chat_bar_tint.dart';
|
|
|
|
/// The conversation bar's model and mode controls read as the bar's other
|
|
/// actions do: neutral, not tinted like a primary call to action. In a
|
|
/// coloured chat's bar they take its foreground ([ChatBarTintScope]) instead.
|
|
///
|
|
/// Material: a [TextButton] style in the role the bar's icon buttons use
|
|
/// (`onSurfaceVariant`).
|
|
ButtonStyle chatBarTextButtonStyle(
|
|
BuildContext context, {
|
|
bool compact = false,
|
|
}) => TextButton.styleFrom(
|
|
foregroundColor:
|
|
ChatBarTintScope.foregroundOf(context) ??
|
|
Theme.of(context).colorScheme.onSurfaceVariant,
|
|
// The same 12 px each side as an icon button's glyph inside its 48 px
|
|
// target, so text sits off its hover/press shape as it does top and bottom.
|
|
padding: compact ? null : chatBarButtonPadding,
|
|
minimumSize: compact ? null : const Size.square(kMinInteractiveDimension),
|
|
);
|
|
|
|
/// Horizontal padding inside the bar's text buttons (model, mode).
|
|
const EdgeInsets chatBarButtonPadding = EdgeInsets.symmetric(horizontal: 12);
|