Files
pipelines/app/lib/features/chat/conversation/chat_card_styles.dart
T
alan 9551eceaed Complete Material-only APIs and fixtures
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
2026-11-11 21:55:39 +00:00

45 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
/// Host-native typography and colour for the approval and question cards.
///
/// The cards share one hierarchy: the card title uses the host's title style,
/// field/answer labels sit visibly below it, and recorded prose uses the body
/// style. Keeping the styles here stops each card file from inventing its own
/// size and colour; everything still comes from the active Material theme, so
/// light, dark and text scaling follow the host.
///
/// All helpers use the shared Material theme roles.
TextStyle? chatCardTitleStyle(BuildContext context) =>
Theme.of(context).textTheme.titleMedium;
TextStyle? chatCardBodyStyle(BuildContext context) =>
Theme.of(context).textTheme.bodyMedium;
/// A field or recorded-answer label: `titleSmall`, so labels sit visibly
/// below the card title without reading as extra headings.
TextStyle? chatCardLabelStyle(BuildContext context) =>
Theme.of(context).textTheme.titleSmall;
/// Body text that supports a control, such as a field description.
TextStyle? chatCardSecondaryStyle(BuildContext context) =>
(chatCardBodyStyle(context) ?? const TextStyle()).copyWith(
color: chatCardSecondaryColor(context),
);
Color chatCardSecondaryColor(BuildContext context) =>
Theme.of(context).colorScheme.onSurfaceVariant;
Color chatCardErrorColor(BuildContext context) =>
Theme.of(context).colorScheme.error;
/// The amber risk hue: the host's warning role, never a bespoke palette.
Color chatCardWarningColor(BuildContext context) =>
Theme.of(context).colorScheme.tertiary;
/// A quiet inset surface for resource blocks and risk panels.
Color chatCardFillColor(BuildContext context) =>
Theme.of(context).colorScheme.surfaceContainerHighest;
Color chatCardWarningFillColor(BuildContext context) =>
Theme.of(context).colorScheme.tertiaryContainer;