orlikraf / flutter-hexagon

MIT License
30 stars 17 forks source link

HexagonGrid: Error: Infinite constraints in both grid dimensions! #24

Open nohkumado opened 8 months ago

nohkumado commented 8 months ago

Hello!

copied over from your example, but as soon as i put contrained: false in the InteractiveViewer it bugs with an exception.....

is there a way to specify the desired cell size?

orlikraf commented 8 months ago

now the widgets expect constraints, why don't you provide them to define the size?

nohkumado commented 8 months ago

ah i found the width in the HexagonWidget but i couldn't pass it on in the Builder?

buildTile: (coordinates) => HexagonWidgetBuilder(
              padding: 2.0,
              cornerRadius: 8.0,
              width: 100, //hexagon 100 pixel width?
              child: Text('${coordinates.q}, ${coordinates.r}'),
            ),

this fails? so how am i supposed to pass on the width of an individual hex?

orlikraf commented 8 months ago

Or consider using the offset grid which is more table-like. It will be easier to guess how many hexagons need to be in each row

nohkumado commented 8 months ago

sorry if i am not very clear , where can i specify those constraints?