[FlutterFormBuilder]: using context.findAncestorStateOfType in FormBuilder.of #1474
Open
1 of 7 tasks
Labels
bug
Something isn't working
Is there an existing issue for this?
Package/Plugin version
9.7.0
Platforms
Flutter doctor
Flutter doctor
Minimal code example
Code sample
Current Behavior
Currently, if you call FormBuilder.of in builder, it calls context.findAncestorStateOfType() which reduces the performance of the application because findAncestorStateOfType enumerates all parent nodes in the tree until it finds FormBuilderState.
In addition, with this approach, the current element is not updated when FormBuilderState changes.
Expected Behavior
FormBuilder.of must use context.dependOnInheritedWidgetOfExactType. Also InheritedWidget must be implemented for FormBuilderState.
Steps To Reproduce
Aditional information
No response
The text was updated successfully, but these errors were encountered: