fromJson method

  1. @override
BoxConstraints? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
BoxConstraints? fromJson(Map<String, dynamic>? json) {
  if (json == null) return null;

  return BoxConstraints(
    maxHeight: ((json['maxHeight'] ?? double.infinity) as num).toDouble(),
    maxWidth: ((json['maxWidth'] ?? double.infinity) as num).toDouble(),
    minHeight: ((json['minHeight'] ?? 0) as num).toDouble(),
    minWidth: ((json['minWidth'] ?? 0) as num).toDouble(),
  );
}