encodeTimePickerThemeData static method

Map<String, dynamic>? encodeTimePickerThemeData(
  1. TimePickerThemeData? value
)

encodes the given value to a TimePickerThemeData. This expects the value to have the following structure:

{
  "backgroundColor": <Color>,
  "dayPeriodBorderSide": <BorderSide>,
  "dayPeriodColor": <Color>,
  "dayPeriodShape": <ShapeBorder>,
  "dayPeriodTextColor": <Color>,
  "dayPeriodTextStyle": <TextStyle>,
  "dialBackgroundColor": <Color>,
  "dialHandColor": <Color>,
  "dialTextColor": <Color>,
  "entryModeIconColor": <Color>,
  "helpTextStyle": <TextStyle>,
  "hourMinuteColor": <Color>,
  "hourMinuteShape": <ShapeBorder>,
  "hourMinuteTextColor": <Color>,
  "hourMinuteTextStyle": <TextStyle>,
  "inputDecorationTheme": <InputDecorationTheme>,
  "shape": <ShapeBorder>
}

See also:

Implementation

static Map<String, dynamic>? encodeTimePickerThemeData(
  TimePickerThemeData? value,
) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'backgroundColor': encodeColor(value.backgroundColor),
      'dayPeriodBorderSide': encodeBorderSide(value.dayPeriodBorderSide),
      'dayPeriodColor': encodeColor(value.dayPeriodColor),
      'dayPeriodShape': encodeShapeBorder(value.dayPeriodShape),
      'dayPeriodTextColor': encodeColor(value.dayPeriodTextColor),
      'dayPeriodTextStyle': encodeTextStyle(value.dayPeriodTextStyle),
      'dialBackgroundColor': encodeColor(value.dialBackgroundColor),
      'dialHandColor': encodeColor(value.dialHandColor),
      'dialTextColor': encodeColor(value.dialTextColor),
      'entryModeIconColor': encodeColor(value.entryModeIconColor),
      'helpTextStyle': encodeTextStyle(value.helpTextStyle),
      'hourMinuteColor': encodeColor(value.hourMinuteColor),
      'hourMinuteShape': encodeShapeBorder(value.hourMinuteShape),
      'hourMinuteTextColor': encodeColor(value.hourMinuteTextColor),
      'hourMinuteTextStyle': encodeTextStyle(value.hourMinuteTextStyle),
      'inputDecorationTheme':
          encodeInputDecorationTheme(value.inputDecorationTheme),
      'shape': encodeShapeBorder(value.shape),
    };
  }

  return result;
}