You should use a GlobalKey and template it depending on the state it is holding if this is the case.
// If you are holding a statefulWidget
final myKey = GlobalKey<YourState>();
// else
final myKey = GlobalKey();
...
RenderBox renderBox = myKey.currentContext.findRenderObject();
You can also use the LayoutBuilder to wrap your child widget with and get their height.
2
Answers
You should use a
GlobalKey
and template it depending on the state it is holding if this is the case.You can also use the
LayoutBuilder
to wrap your child widget with and get their height.This is valid code calculateHeight() fill fix ur problem.