TemplateThemeData constructor
TemplateThemeData({
- Brightness? brightness,
- FlutterLogoColor? flutterLogoColor,
- TextStyle? titleTextStyle,
- TextStyle? descriptionTextStyle,
- Color? backgroundColor,
- ButtonThemeData? buttonTheme,
- FrameThemeData? frameTheme,
- TextStyle? buttonTextStyle,
- IconThemeData? buttonIconTheme,
Implementation
factory TemplateThemeData({
Brightness? brightness,
FlutterLogoColor? flutterLogoColor,
TextStyle? titleTextStyle,
TextStyle? descriptionTextStyle,
Color? backgroundColor,
ButtonThemeData? buttonTheme,
FrameThemeData? frameTheme,
TextStyle? buttonTextStyle,
IconThemeData? buttonIconTheme,
}) {
brightness ??= Brightness.light;
final bool isDark = brightness == Brightness.dark;
backgroundColor ??= isDark ? Colors.grey[850] : Colors.grey[50];
final textColor = isDark ? Colors.white : Colors.black;
descriptionTextStyle =
TextStyle(color: textColor, height: 1.8, fontSize: 18).merge(
descriptionTextStyle ?? TextStyle(),
);
titleTextStyle = TextStyle(
fontSize: 60.0,
color: textColor,
fontWeight: FontWeight.w400,
textBaseline: TextBaseline.alphabetic,
letterSpacing: -0.5)
.merge(titleTextStyle ?? TextStyle());
buttonTheme ??= ButtonThemeData(
padding: EdgeInsets.all(12),
buttonColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(color: Colors.grey),
),
);
buttonIconTheme ??= IconThemeData();
buttonTextStyle ??= TextStyle();
flutterLogoColor ??= FlutterLogoColor.original;
frameTheme ??= FrameThemeData();
return TemplateThemeData.raw(
brightness: brightness,
flutterLogoColor: flutterLogoColor,
titleTextStyle: titleTextStyle,
backgroundColor: backgroundColor!,
descriptionTextStyle: descriptionTextStyle,
buttonTheme: buttonTheme,
buttonTextStyle: buttonTextStyle,
buttonIconTheme: buttonIconTheme,
frameTheme: frameTheme);
}