I got a trouble but can't solve. I have this code
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) => yourFunction(context));
}
And I got
The method 'addPostFrameCallback' can't be unconditionally invoked because the receiver can be 'null'. Try making the call conditional (using '?.') or adding a null check to the target ('!').
Why and How can I fix that ?