ChatTheme.fromThemeData constructor

ChatTheme.fromThemeData(
  1. ThemeData themeData,
  2. ChatTheme? chatTheme
)

Implementation

factory ChatTheme.fromThemeData(ThemeData themeData, ChatTheme? chatTheme) {
  final baseTheme = chatTheme ?? ChatTheme();
  return baseTheme.copyWith(
    backgroundColor: themeData.colorScheme.surface,

    // App Bar
    appBarBackgroundColor: themeData.colorScheme.surface,
    actionIconColor: themeData.colorScheme.onSurface,

    // User messages
    userMessageColor: themeData.colorScheme.surfaceContainerHighest,
    userMessageTextStyle: baseTheme.userMessageTextStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),

    // Assistant messages
    assistantMessageTextStyle: baseTheme.assistantMessageTextStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),

    // Main text input
    inputTextFieldColor: themeData.colorScheme.surface,
    inputTextFieldBorderColor: themeData.colorScheme.outline,
    attachmentPickerBackgroundColor: themeData.colorScheme.surface,
    pickerButtonBorderColor: themeData.colorScheme.onSurfaceVariant,
    cancelRecordingIconColor: themeData.colorScheme.onSurfaceVariant,
    attachIconColor: themeData.colorScheme.onSurfaceVariant,
    cameraIconColor: themeData.colorScheme.onSurfaceVariant,
    galleryIconColor: themeData.colorScheme.onSurfaceVariant,

    modalHeaderStyle: baseTheme.modalHeaderStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),
    hintTextStyle: baseTheme.hintTextStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),
    timerTextStyle: baseTheme.timerTextStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),

    // Main button
    sendButtonColor: themeData.colorScheme.primary,
    sendButtonForegroundColor: themeData.colorScheme.onPrimary,

    // Audio wave component
    waveColor: themeData.colorScheme.primary,
    playAudioIconColor: themeData.colorScheme.onSurfaceVariant,
    pauseAudioIconColor: themeData.colorScheme.onSurfaceVariant,

    // Product card
    cardBackgroundColor: themeData.colorScheme.surface,
    cardBorderColor: themeData.colorScheme.outline,
    currencyIconColor: themeData.colorScheme.onSurfaceVariant,
    numericControlIconColor: themeData.colorScheme.onSurfaceVariant,
    imagePlaceholderIconColor: themeData.colorScheme.onSurfaceVariant,
    imagePlaceholderBackgroundColor:
        themeData.colorScheme.surfaceContainerHighest,
    productPriceBackgroundColor: themeData.colorScheme.tertiaryContainer,
    pricePerSubunitColor: themeData.colorScheme.onSurfaceVariant,

    productTitleStyle: baseTheme.productTitleStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),
    productSubunitsStyle: baseTheme.productSubunitsStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),

    productPriceStyle: baseTheme.productPriceStyle.copyWith(
      color: themeData.colorScheme.onTertiaryContainer,
    ),
    productSalePriceStrikeStyle: baseTheme.productSalePriceStrikeStyle
        .copyWith(color: themeData.colorScheme.onTertiaryContainer),
    pricePerSubunitStyle: baseTheme.pricePerSubunitStyle.copyWith(
      color: themeData.colorScheme.onSurfaceVariant,
    ),
    expandControlsStyle: baseTheme.expandControlsStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),

    // Quick reply
    quickReplyColor: themeData.colorScheme.surfaceContainerHighest,
    quickReplyBorderColor: themeData.colorScheme.outline,
    quickReplyStyle: baseTheme.quickReplyStyle.copyWith(
      color: themeData.colorScheme.onSurface,
    ),
  );
}