FeedbackOSTheme.fromTheme constructor

FeedbackOSTheme.fromTheme(
  1. ThemeData theme
)

Derives theme colors from Flutter's standard ThemeData.

Implementation

factory FeedbackOSTheme.fromTheme(ThemeData theme) {
  final cs = theme.colorScheme;
  return FeedbackOSTheme(
    primaryColor: cs.primary,
    onPrimaryColor: cs.onPrimary,
    backgroundColor: cs.surface,
    surfaceColor: cs.surfaceContainerLowest,
    secondaryBackgroundColor: cs.surfaceContainerHighest,
    borderColor: cs.outlineVariant,
    titleColor: cs.onSurface,
    textColor: cs.onSurface,
    secondaryTextColor: cs.onSurfaceVariant,
    mutedTextColor: cs.onSurfaceVariant.withAlpha(180),
    errorColor: cs.error,
    buttonColor: cs.primary,
  );
}