encodeGradientTransform static method

Map<String, dynamic>? encodeGradientTransform(
  1. GradientTransform? value
)

Encodes the given value to the String representation. This only supports the following GradientTransform subclasses:

The emitted JSON will depend on the GradientTransform type and are each described below:

GradientRotation

{
  "radians": <double>
}

Implementation

static Map<String, dynamic>? encodeGradientTransform(
    GradientTransform? value) {
  assert(value == null || value is GradientRotation);
  Map<String, dynamic>? result;

  if (value != null && value is GradientRotation) {
    result = {
      'radians': value.radians,
    };
  }

  return result;
}