PersianDate.fromJson constructor

PersianDate.fromJson(
  1. String json
)

Creates a date from the yyyy-MM-dd string written by toJson.

Accepts everything parse accepts and throws FormatException for invalid input. json_serializable uses it, together with toJson, for PersianDate fields without any annotation.

Implementation

factory PersianDate.fromJson(String json) => parse(json);