I solved this by removing the flutter whole folder where it is saved and than remove the Environmental Values and remove path and add new download new Flutter SDK and than again update the path in Environmental Values
You can’t send context to a function when it isn’t even defined in the initstate function. Here you are trying to use provider outside the Build Function which is a no no. What you can do as an alternative is to wrap the function with a Future to give it a valid context :
2
Answers
I solved this by removing the flutter whole folder where it is saved and than remove the Environmental Values and remove path and add new download new Flutter SDK and than again update the path in Environmental Values
You can’t send context to a function when it isn’t even defined in the initstate function. Here you are trying to use provider outside the Build Function which is a no no. What you can do as an alternative is to wrap the function with a Future to give it a valid context :