toThemeData method
Implementation
ThemeData toThemeData() {
return ThemeData(
brightness: brightness,
primaryColor: primaryColor,
scaffoldBackgroundColor: scaffoldBackgroundColor,
cardColor: cardColor,
textTheme: _buildTextTheme(),
appBarTheme: AppBarTheme(
elevation: 0,
backgroundColor: scaffoldBackgroundColor,
foregroundColor: textColor,
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, backgroundColor: primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
),
), colorScheme: ColorScheme.fromSwatch(
brightness: brightness,
primarySwatch: _createMaterialColor(primaryColor),
).copyWith(
secondary: accentColor,
).copyWith(background: backgroundColor),
);
}