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>",
  "cancelButtonStyle": "<ButtonStyle>",
  "confirmButtonStyle": "<ButtonStyle>",
  "dayPeriodBorderSide": "<BorderSide>",
  "dayPeriodColor": "<Color>",
  "dayPeriodShape": "<ShapeBorder>",
  "dayPeriodTextColor": "<Color>",
  "dayPeriodTextStyle": "<TextStyle>",
  "dialBackgroundColor": "<Color>",
  "dialHandColor": "<Color>",
  "dialTextColor": "<Color>",
  "dialTextStyle": "<TextStyle>",
  "elevation": "<double>",
  "entryModeIconColor": "<Color>",
  "helpTextStyle": "<TextStyle>",
  "hourMinuteColor": "<Color>",
  "hourMinuteShape": "<ShapeBorder>",
  "hourMinuteTextColor": "<Color>",
  "hourMinuteTextStyle": "<TextStyle>",
  "inputDecorationTheme": "<InputDecorationTheme>",
  "padding": "<EdgeInsetsGeometry>",
  "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),
      'cancelButtonStyle': encodeButtonStyle(value.cancelButtonStyle),
      'confirmButtonStyle': encodeButtonStyle(value.confirmButtonStyle),
      '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),
      'dialTextStyle': encodeTextStyle(value.dialTextStyle),
      'elevation': value.elevation,
      '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,
      ),
      'padding': encodeEdgeInsetsGeometry(value.padding as EdgeInsets?),
      'shape': encodeShapeBorder(value.shape),
    };
  }

  return _stripDynamicNull(result);
}