Sometimes Flutter/Dart shows random CERTIFICATE_VERIFY_FAILED error. Mostly it happens when try to request POST or fetch images. Below are simple steps to avoid this error.
In your main.dart file, add or import the following class:
In your main function, add the following line after function definition:
As we all know that Provider is the best known state management package available for flutter application development.
initState method called when this object is inserted into the tree.
The framework will call this method exactly once for each State object it creates.
You need to use the context to call Provider.of() so you can add addPostFrameCallback() which is called after the first build, there you can use the context