ThemeData constructor

ThemeData({
  1. Brightness? brightness,
  2. Typography? typography,
  3. AccentColor? accentColor,
  4. Color? activeColor,
  5. Color? inactiveColor,
  6. Color? inactiveBackgroundColor,
  7. Color? disabledColor,
  8. Color? scaffoldBackgroundColor,
  9. Color? navigationPanelBackgroundColor,
  10. Color? shadowColor,
  11. ButtonState<MouseCursor>? inputMouseCursor,
  12. Duration? fasterAnimationDuration,
  13. Duration? fastAnimationDuration,
  14. Duration? mediumAnimationDuration,
  15. Duration? slowAnimationDuration,
  16. Curve? animationCurve,
  17. ButtonThemeData? buttonTheme,
  18. CheckboxThemeData? checkboxTheme,
  19. ToggleSwitchThemeData? toggleSwitchTheme,
  20. IconThemeData? iconTheme,
  21. SplitButtonThemeData? splitButtonTheme,
  22. ContentDialogThemeData? dialogTheme,
  23. TooltipThemeData? tooltipTheme,
  24. DividerThemeData? dividerTheme,
  25. NavigationPanelThemeData? navigationPanelTheme,
  26. RadioButtonThemeData? radioButtonTheme,
  27. ToggleButtonThemeData? toggleButtonTheme,
  28. SliderThemeData? sliderTheme,
  29. InfoBarThemeData? infoBarTheme,
  30. FocusThemeData? focusTheme,
  31. ScrollbarThemeData? scrollbarTheme,
})

Implementation

factory ThemeData({
  Brightness? brightness,
  Typography? typography,
  AccentColor? accentColor,
  Color? activeColor,
  Color? inactiveColor,
  Color? inactiveBackgroundColor,
  Color? disabledColor,
  Color? scaffoldBackgroundColor,
  Color? navigationPanelBackgroundColor,
  Color? shadowColor,
  ButtonState<MouseCursor>? inputMouseCursor,
  Duration? fasterAnimationDuration,
  Duration? fastAnimationDuration,
  Duration? mediumAnimationDuration,
  Duration? slowAnimationDuration,
  Curve? animationCurve,
  ButtonThemeData? buttonTheme,
  CheckboxThemeData? checkboxTheme,
  ToggleSwitchThemeData? toggleSwitchTheme,
  IconThemeData? iconTheme,
  SplitButtonThemeData? splitButtonTheme,
  ContentDialogThemeData? dialogTheme,
  TooltipThemeData? tooltipTheme,
  DividerThemeData? dividerTheme,
  NavigationPanelThemeData? navigationPanelTheme,
  RadioButtonThemeData? radioButtonTheme,
  ToggleButtonThemeData? toggleButtonTheme,
  SliderThemeData? sliderTheme,
  InfoBarThemeData? infoBarTheme,
  FocusThemeData? focusTheme,
  ScrollbarThemeData? scrollbarTheme,
}) {
  brightness ??= Brightness.light;
  fasterAnimationDuration ??= Duration(milliseconds: 90);
  fastAnimationDuration ??= Duration(milliseconds: 150);
  mediumAnimationDuration ??= Duration(milliseconds: 300);
  slowAnimationDuration ??= Duration(milliseconds: 500);
  animationCurve ??= standartCurve;
  accentColor ??= Colors.blue;
  activeColor ??= Colors.white;
  inactiveColor ??= AccentColor('normal', {
    'normal': Colors.black,
    'dark': Colors.white,
  }).resolveFromBrightness(brightness);
  inactiveBackgroundColor ??= AccentColor('normal', {
    'normal': Color(0xFFd6d6d6),
    'dark': Color(0xFF292929),
  }).resolveFromBrightness(brightness);
  disabledColor ??= Colors.grey[100]!.withOpacity(0.6);
  shadowColor ??= AccentColor('normal', {
    'normal': Colors.black,
    'dark': Colors.grey[130]!,
  }).resolveFromBrightness(brightness);
  scaffoldBackgroundColor ??= AccentColor('normal', {
    'normal': Colors.white,
    'dark': Colors.black,
  }).resolveFromBrightness(brightness);
  navigationPanelBackgroundColor ??= navigationPanelBackgroundColor ??
      AccentColor('normal', {
        'normal': Color.fromARGB(255, 230, 230, 230),
        'dark': Color.fromARGB(255, 25, 25, 25)
      }).resolveFromBrightness(brightness);
  typography =
      Typography.standart(brightness: brightness).copyWith(typography);
  inputMouseCursor ??= (state) {
    if (state.isHovering || state.isPressing)
      return SystemMouseCursors.click;
    else
      return MouseCursor.defer;
  };
  focusTheme = FocusThemeData.standard(
    glowColor: accentColor.withOpacity(0.15),
    primaryBorderColor: inactiveColor,
    secondaryBorderColor: scaffoldBackgroundColor,
    animationCurve: animationCurve,
    animationDuration: fasterAnimationDuration,
  ).copyWith(focusTheme);
  buttonTheme ??= const ButtonThemeData();
  checkboxTheme ??= const CheckboxThemeData();
  toggleButtonTheme ??= const ToggleButtonThemeData();
  toggleSwitchTheme ??= const ToggleSwitchThemeData();
  iconTheme ??= const IconThemeData();
  splitButtonTheme ??= const SplitButtonThemeData();
  dialogTheme ??= const ContentDialogThemeData();
  tooltipTheme ??= const TooltipThemeData();
  dividerTheme ??= const DividerThemeData();
  navigationPanelTheme ??= const NavigationPanelThemeData();
  radioButtonTheme ??= const RadioButtonThemeData();
  sliderTheme ??= const SliderThemeData();
  infoBarTheme ??= const InfoBarThemeData();
  scrollbarTheme ??= const ScrollbarThemeData();
  return ThemeData.raw(
    brightness: brightness,
    fasterAnimationDuration: fasterAnimationDuration,
    fastAnimationDuration: fastAnimationDuration,
    mediumAnimationDuration: mediumAnimationDuration,
    slowAnimationDuration: slowAnimationDuration,
    animationCurve: animationCurve,
    accentColor: accentColor,
    activeColor: activeColor,
    inactiveColor: inactiveColor,
    inactiveBackgroundColor: inactiveBackgroundColor,
    disabledColor: disabledColor,
    scaffoldBackgroundColor: scaffoldBackgroundColor,
    navigationPanelBackgroundColor: navigationPanelBackgroundColor,
    shadowColor: shadowColor,
    buttonTheme: buttonTheme,
    checkboxTheme: checkboxTheme,
    dialogTheme: dialogTheme,
    dividerTheme: dividerTheme,
    focusTheme: focusTheme,
    iconTheme: iconTheme,
    infoBarTheme: infoBarTheme,
    navigationPanelTheme: navigationPanelTheme,
    radioButtonTheme: radioButtonTheme,
    scrollbarTheme: scrollbarTheme,
    sliderTheme: sliderTheme,
    splitButtonTheme: splitButtonTheme,
    toggleButtonTheme: toggleButtonTheme,
    toggleSwitchTheme: toggleSwitchTheme,
    tooltipTheme: tooltipTheme,
    typography: typography,
    inputMouseCursor: inputMouseCursor,
  );
}