getGrouped method

List<List<FxFlexItem>> getGrouped(
  1. FxScreenMediaType type
)

Implementation

List<List<FxFlexItem>> getGrouped(FxScreenMediaType type) {
  List<List<FxFlexItem>> list = [];
  var flexCount = 0;
  List<FxFlexItem> iList = [];
  for (FxFlexItem col in children) {
    if (col.display[type]!.isBlock) {
      int flex = col.flex[type]!;
      if (flexCount + flex <= 12) {
        iList.add(col);
        flexCount += flex;
      } else {
        list.add(iList);
        iList = [];
        iList.add(col);
        flexCount = 0;
      }
    }
  }
  if (iList.isNotEmpty) {
    list.add(iList);
  }
  return list;
}