orlikraf / flutter-hexagon

MIT License
31 stars 17 forks source link

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

Open nohkumado opened 11 months ago

nohkumado commented 11 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 11 months ago

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

nohkumado commented 11 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 11 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 11 months ago

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