Margin.fromJson constructor

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

Implementation

Margin.fromJson(Map<String, dynamic> json) {
  top = json['top'] is int
      ? json['top'].toDouble()
      : (json['top'].toString().isEmpty
          ? 0.0
          : double.parse(json['top'].toString()));
  bottom = json['bottom'] is int
      ? json['bottom'].toDouble()
      : (json['bottom'].toString().isEmpty
          ? 0.0
          : double.parse(json['bottom'].toString()));
  left = json['left'] is int
      ? json['left'].toDouble()
      : (json['left'].toString().isEmpty
          ? 0.0
          : double.parse(json['left'].toString()));
  right = json['right'] is int
      ? json['right'].toDouble()
      : (json['right'].toString().isEmpty
          ? 0.0
          : double.parse(json['right'].toString()));
}