HexagonOffsetGrid.evenFlat constructor

HexagonOffsetGrid.evenFlat({
  1. required int columns,
  2. required int rows,
  3. Color? color,
  4. EdgeInsets? padding,
  5. HexagonWidgetBuilder? buildTile(
    1. int col,
    2. int row
    )?,
  6. Widget buildChild(
    1. int col,
    2. int row
    )?,
  7. HexagonWidgetBuilder? hexagonBuilder,
})

Grid of flat hexagons with even columns starting with tile and odd with a space.

columns - Required positive integer. Count of columns in grid.

rows - Required positive integer. Count of rows in grid.

color - Background color of this grid.

padding - Grid padding.

hexagonBuilder - Used as template for tiles. Will be overridden by buildTile.

buildTile - Provide a HexagonWidgetBuilder that will be used to create given tile (at col,row). Return null to use default hexagonBuilder.

buildChild - Provide a Widget to be used in a HexagonWidget for given tile (col,row). Any returned value will override child provided in buildTile or hexagonBuilder.

Implementation

HexagonOffsetGrid.evenFlat({
  required this.columns,
  required this.rows,
  this.color,
  this.padding,
  this.buildTile,
  this.buildChild,
  this.hexagonBuilder,
})  : this.hexType = HexagonType.FLAT,
      this.gridType = GridType.EVEN;