fromFlutterTheme static method

Map<String, dynamic> fromFlutterTheme(
  1. ThemeData theme
)

Implementation

static Map<String, dynamic> fromFlutterTheme(ThemeData theme) {
  return {
    'primaryColor': theme.colorScheme.primary.toARGB32(),
    'secondaryColor': theme.colorScheme.secondary.toARGB32(),
    'surfaceColor': theme.colorScheme.surface.toARGB32(),
    'errorColor': theme.colorScheme.error.toARGB32(),
    'backgroundColor': theme.scaffoldBackgroundColor.toARGB32(),
    'brightness': theme.brightness == Brightness.dark ? 'dark' : 'light',
  };
}