FlutterDeckThemeData.fromTheme constructor

FlutterDeckThemeData.fromTheme(
  1. ThemeData theme
)

Creates a theme to style a slide deck from a ThemeData.

Implementation

factory FlutterDeckThemeData.fromTheme(ThemeData theme) {
  final defaultTheme = FlutterDeckThemeData(brightness: theme.brightness);
  final textTheme = defaultTheme.textTheme.apply(
    color: theme.colorScheme.onSurface,
    fontFamily: theme.textTheme.bodyMedium?.fontFamily,
  );
  final customTheme = FlutterDeckThemeData.fromThemeAndText(theme, textTheme);

  return defaultTheme.merge(customTheme);
}