parseBoxConstraints function
Implementation
BoxConstraints parseBoxConstraints(Map<String, dynamic>? map) {
double minWidth = 0.0;
double maxWidth = double.infinity;
double minHeight = 0.0;
double maxHeight = double.infinity;
if (map != null) {
if (map.containsKey('minWidth')) {
var minWidthValue = map['minWidth']?.toDouble();
if (minWidthValue != null) {
if (minWidthValue >= infinity) {
minWidth = double.infinity;
} else {
minWidth = minWidthValue;
}
}
}
if (map.containsKey('maxWidth')) {
var maxWidthValue = map['maxWidth']?.toDouble();
if (maxWidthValue != null) {
if (maxWidthValue >= infinity) {
maxWidth = double.infinity;
} else {
maxWidth = maxWidthValue;
}
}
}
if (map.containsKey('minHeight')) {
var minHeightValue = map['minHeight']?.toDouble();
if (minHeightValue != null) {
if (minHeightValue >= infinity) {
minHeight = double.infinity;
} else {
minHeight = minHeightValue;
}
}
}
if (map.containsKey('maxHeight')) {
var maxHeightValue = map['maxHeight']?.toDouble();
if (maxHeightValue != null) {
if (maxHeightValue >= infinity) {
maxHeight = double.infinity;
} else {
maxHeight = maxHeightValue;
}
}
}
}
return BoxConstraints(
minWidth: minWidth,
maxWidth: maxWidth,
minHeight: minHeight,
maxHeight: maxHeight,
);
}