Duration.fromJSON constructor

Duration.fromJSON(
  1. Map<String, dynamic> data
)

Implementation

factory Duration.fromJSON(Map<String, dynamic> data) {
	return Duration(
		value: (data["value"] as num?)?.toDouble(),
		unit: data["unit"] == null ? null : CodeStub.fromJSON(data["unit"])
	);
}