orlikraf / flutter-hexagon

MIT License
30 stars 17 forks source link

Make hexagon_painter.hittest null safe #4

Closed sshipman closed 3 years ago

sshipman commented 3 years ago

I've discovered that when trying to make a drag/droppable hexagon, hittest may be called before paint has had a chance to set the _path, resulting in a cascade of null pointer errors on dragging over DropTargets with HexagonWidget children. The fix is to simply check that _path is non null before checking contains, and return false if not. Latest versions of CustomPainter are null-safety enabled and update the return type to bool? so it could be even simpler if the library is updated to null-safety.

sshipman commented 3 years ago

PR merged.