resolve method

VoicebotResolvedTheme resolve(
  1. BuildContext context
)

Resolves colors/typography against the ambient theme, so the kit blends with the host app unless explicit colors were pinned.

Implementation

VoicebotResolvedTheme resolve(BuildContext context) {
  final scheme = Theme.of(context).colorScheme;
  final text = Theme.of(context).textTheme;
  final buttonBg = buttonBackground ?? scheme.primary;
  return VoicebotResolvedTheme(
    base: this,
    buttonBackground: buttonBg,
    buttonForeground: buttonForeground ?? scheme.onPrimary,
    accent: accent ?? scheme.secondary,
    pulseColor: pulseColor ?? buttonBg,
    panelBackground: panelBackground ?? scheme.surface,
    userBubbleColor: userBubbleColor ?? scheme.primaryContainer,
    userTextColor: userTextColor ?? scheme.onPrimaryContainer,
    botBubbleColor: botBubbleColor ?? scheme.surfaceContainerHighest,
    botTextColor: botTextColor ?? scheme.onSurface,
    titleStyle: titleStyle ?? text.titleMedium ?? const TextStyle(fontSize: 16),
    bubbleTextStyle: bubbleTextStyle ?? text.bodyMedium ?? const TextStyle(fontSize: 14),
  );
}