fromJson static method

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

Returns a new Chart instance and imports its values from json if it's non-null, null if json is null.

Implementation

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

  return Chart(
    data: json[r'data'] == null ? null : List<int>.from(json[r'data']),
    labels:
        json[r'labels'] == null ? null : List<String>.from(json[r'labels']),
  );
}