-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I have a page in my application that builds a NodeEditor, but I retain the controller for it in a global state.
If I rebuild the NodeEditor (the second time) with the previously used controller (that has a bunch of nodes and connections), I get a crash in render_info.dart:16:
/// get the position of object in the screen, correcting by the position of
/// vertical and horizontal scroll
Offset getObjectPosition(NodeEditorController controller, GlobalKey key) {
var obj = key.currentContext?.findRenderObject();
final RenderBox stackRenderBox = obj as RenderBox; /// <-- obj IS NULL HERE!
// fix position by scroll position
return stackRenderBox.localToGlobal(Offset.zero) -
controller.stackPos! +
Offset(controller.horizontalScrollController.offset,
controller.verticalScrollController.offset);
}Seems like its due to the global key being recreated when the pins are being recreated (in _InPortWidgetState, when you call controller.addInPort).
Is this a bug, or am I using the library wrong? It works phenomenally otherwise, thank you for creating another fantastic flutter package!
Metadata
Metadata
Assignees
Labels
No labels