LayoutConfig.fromJson constructor

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

Implementation

factory LayoutConfig.fromJson(Map<String, dynamic> json) {
  return LayoutConfig(
    width: (json['width'] as num?)?.toDouble(),
    height: (json['height'] as num?)?.toDouble(),
    maxWidth: (json['max_width'] as num?)?.toDouble(),
    maxHeight: (json['max_height'] as num?)?.toDouble(),
    padding: _parseEdgeInsets(json['padding']),
    margin: _parseEdgeInsets(json['margin']),
    expand: json['expand'] as bool? ?? true,
    aspectRatio: (json['aspect_ratio'] as num?)?.toDouble(),
  );
}