ReaderConfig.fromJson constructor

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

Implementation

factory ReaderConfig.fromJson(Map<String, dynamic> json) {
  return ReaderConfig(
    axis: Axis.values[json["axis"] as int],
    fontWeight: FontWeight.values[json["fontWeight"] as int],
    fontStyle: FontStyle.values[json["fontStyle"] as int],
    textAlign: TextAlign.values[json["textAlign"] as int],
    fontFamily: json["fontFamily"],
    fontSize: json["fontSize"],
    lineHeight: json["lineHeight"],
    padding: EdgeInsets.fromLTRB(
      json["padding"]["left"],
      json["padding"]["top"],
      json["padding"]["right"],
      json["padding"]["bottom"],
    ),
    backgroundColor: Color(json["backgroundColor"]),
    foregroundColor: Color(json["foregroundColor"]),
  );
}