This is a simplified version of the scenario:
class ParentWdiegt extends StatelessWidget{
//
//
floatinActionButton: FloatingActionButtonWidget(onPressed:()=
Try to store the state of the widget and then access
class MySFWidget extends StatefulWidget {
SFWidgetState currState;
@override
SFWidgetState createState(){
currState = new SFWidgetState();
return currState;
};
}
class SFWidgetState extends State {
int prop;
void SomeMethod(){
// DO Something
}
@override
Widget build(BuildContext context) {
return null;
}
}
Then, access its property or call method by :
myWidgetInstance.currState.prop
myWidgetInstance.currState.SomeMethod()