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.
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.