addComponentRow method

void addComponentRow(
  1. ComponentRowBuilder componentRowBuilder
)

Allows to add

Implementation

void addComponentRow(ComponentRowBuilder componentRowBuilder) {
  if (this.components == null) {
    this.components = [];
  }

  if (componentRowBuilder._components.length > 5 || componentRowBuilder._components.isEmpty) {
    throw ArgumentError("Component row cannot be empty or have more than 5 components");
  }

  if (this.components!.length == 5) {
    throw ArgumentError("There cannot be more that 5 rows of components");
  }

  this.components!.add(componentRowBuilder._components);
}