Relative Content

Tag Archive for flutterstatefulwidget

How can I pass an object to a StatefulWidget inside another’s build?

I’m currently testing how to implement a dashboard page where I make a page out of multiple StatefulWidgets to make maintaining fairly easy later on. I already know how to pass objects between StatefulWidgets, but I’m having an issue passing the same object to a StatefulWidget that is inside another StatefulWidget’s build. I’m getting an error saying “Invalid constant value” on the object I passed to the child StatefulWidget. I’ve tried to change the child StatefulWidget’s constructor like remove the required for the object parameter or making the constructor not constant, but it results in other kinds of error on that widget.