forceInternetOnOffSimulation property
If you are running tests, you can change forceInternetOnOffSimulation to simulate the internet connection as ON or OFF for the provided mixins CheckInternet, AbortWhenNoInternet, and UnlimitedRetryCheckInternet.
- Return
trueif there IS internet. - Return
falseif there is NO internet. - Return
nullto use the real internet connection status (default).
Example:
store.forceInternetOnOffSimulation = () => false;
This is specially useful during tests, for testing what happens when you have no internet connection. And since it's tied to the store, it automatically resets when the store is recreated.
Implementation
bool? Function() forceInternetOnOffSimulation = () => null;