fromJson static method

BackgroundFillFreeformGradient? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static BackgroundFillFreeformGradient? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return BackgroundFillFreeformGradient(
    colors: List<int>.from(((json['colors'] as List<dynamic>?) ?? <dynamic>[])
        .map((item) =>
            (item is int ? item : int.tryParse(item.toString()) ?? 0))
        .toList()),
  );
}