PlutoColumnGroup constructor

PlutoColumnGroup({
  1. required String title,
  2. List<String>? fields,
  3. List<PlutoColumnGroup>? children,
  4. EdgeInsets? titlePadding,
  5. InlineSpan? titleSpan,
  6. PlutoColumnTextAlign titleTextAlign = PlutoColumnTextAlign.center,
  7. bool? expandedColumn = false,
  8. Color? backgroundColor,
  9. Key? key,
})

Implementation

PlutoColumnGroup({
  required this.title,
  this.fields,
  this.children,
  this.titlePadding,
  this.titleSpan,
  this.titleTextAlign = PlutoColumnTextAlign.center,
  this.expandedColumn = false,
  this.backgroundColor,
  Key? key,
})  : assert(fields == null
          ? (children != null && children.isNotEmpty)
          : fields.isNotEmpty && children == null),
      assert(expandedColumn == true
          ? fields?.length == 1 && children == null
          : true),
      _key = key ?? UniqueKey() {
  hasFields = fields != null;

  hasChildren = !hasFields;

  if (hasChildren) {
    for (final child in children!) {
      child.parent = this;
    }
  }
}