encodeTextSelectionThemeData static method

Map<String, dynamic>? encodeTextSelectionThemeData(
  1. TextSelectionThemeData? value
)

Encodes a given value into a JSON compatible Map structure. This will return the following structure:

  "cursorColor": <Color>,
  "selectionColor": <Color>,
  "selectionHandleColor": <Color>

See also:

Implementation

static Map<String, dynamic>? encodeTextSelectionThemeData(
    TextSelectionThemeData? value) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'cursorColor': encodeColor(
        value.cursorColor,
      ),
      'selectionColor': encodeColor(
        value.selectionColor,
      ),
      'selectionHandleColor': encodeColor(
        value.selectionHandleColor,
      ),
    };
  }

  return _stripNull(result);
}