fromJson static method

ExportedMaxLength fromJson(
  1. Map<String, Object?> json
)

Implementation

static ExportedMaxLength fromJson(Map<String, Object?> json) {
  ExportedShot? shot(Object? value) => switch (value) {
    Map shot => ExportedShot.fromJson(shot.cast<String, Object?>()),
    _ => null,
  };
  var fits = switch (json['fits']) {
    Map fits => fits.cast<String, Object?>(),
    _ => const <String, Object?>{},
  };
  var clips = switch (json['clips']) {
    Map clips => clips.cast<String, Object?>(),
    _ => null,
  };
  return ExportedMaxLength(
    chars: _int(json['chars']),
    fitsText: fits['text'] as String?,
    clipsChars: clips == null ? null : _int(clips['chars']),
    clipsText: clips?['text'] as String?,
    screen: shot(json['screen']),
    clipped: shot(json['clipped']),
    measuredOn: json['measuredOn'] as String?,
  );
}