generate method

  1. @override
Widget generate(
  1. Context context
)
override

Implementation

@override
Widget generate(Context context) {
  // check if new file is needed
  if (groupMin > -1 && children.isNotEmpty) {
    var childrenNum = children.length;
    // add all widget generated from a strait widget
    if (children.first is StraitWidget) {
      childrenNum += (children.first as StraitWidget).result.length;
    }
    if (childrenNum >= groupMin) {
      return IndexedFile(
        generateIDs && filename != null ? filename! : 'group',
        execute: true,
        child: For.of(children),
        custom: generateIDs && filename != null ? null : filename,
        path: path,
      );
    }
  }
  return For.of(children);
}