Duration.fromJson constructor

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

Implementation

factory Duration.fromJson(Map<String, dynamic> json) {
  return Duration(
    unit: (json['unit'] as String?)?.toDurationUnit(),
    value: json['value'] as int?,
  );
}