parseRectangleFromList function

Rectangle<num>? parseRectangleFromList(
  1. List list
)

Parses list as a Rectangle.

Implementation

Rectangle<num>? parseRectangleFromList(List list) {
  if (list.length < 4) return null;
  list = list.map((e) => parseNum(e)).whereType<num>().toList();
  if (list.length < 4) return null;
  return Rectangle(list[0], list[1], list[2], list[3]);
}