33 lines
1.2 KiB
Dart
33 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../ui/theme/app_design_tokens.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
|
|
: Size.square(
|
|
AppDesignTokens.of(context).density.dense
|
|
? 32
|
|
: kMinInteractiveDimension,
|
|
),
|
|
);
|
|
|
|
/// Horizontal padding inside the bar's text buttons (model, mode).
|
|
const EdgeInsets chatBarButtonPadding = EdgeInsets.symmetric(horizontal: 12);
|