96de9f5bea
Keep the Material-only conversation implementation while preserving public Cupertino parameters for callers. Narrow affected tests to Material hosts so the dead platform paths are no longer exercised.
46 lines
2.1 KiB
Dart
46 lines
2.1 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.
|
|
///
|
|
/// The `cupertino` parameters are kept for existing callers; the app is
|
|
/// Material-only, so every helper returns its Material value.
|
|
TextStyle? chatCardTitleStyle(BuildContext context, bool cupertino) =>
|
|
Theme.of(context).textTheme.titleMedium;
|
|
|
|
TextStyle? chatCardBodyStyle(BuildContext context, bool cupertino) =>
|
|
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, bool cupertino) =>
|
|
Theme.of(context).textTheme.titleSmall;
|
|
|
|
/// Body text that supports a control, such as a field description.
|
|
TextStyle? chatCardSecondaryStyle(BuildContext context, bool cupertino) =>
|
|
(chatCardBodyStyle(context, cupertino) ?? const TextStyle()).copyWith(
|
|
color: chatCardSecondaryColor(context, cupertino),
|
|
);
|
|
|
|
Color chatCardSecondaryColor(BuildContext context, bool cupertino) =>
|
|
Theme.of(context).colorScheme.onSurfaceVariant;
|
|
|
|
Color chatCardErrorColor(BuildContext context, bool cupertino) =>
|
|
Theme.of(context).colorScheme.error;
|
|
|
|
/// The amber risk hue: the host's warning role, never a bespoke palette.
|
|
Color chatCardWarningColor(BuildContext context, bool cupertino) =>
|
|
Theme.of(context).colorScheme.tertiary;
|
|
|
|
/// A quiet inset surface for resource blocks and risk panels.
|
|
Color chatCardFillColor(BuildContext context, bool cupertino) =>
|
|
Theme.of(context).colorScheme.surfaceContainerHighest;
|
|
|
|
Color chatCardWarningFillColor(BuildContext context, bool cupertino) =>
|
|
Theme.of(context).colorScheme.tertiaryContainer;
|