You have to use the 'Connectivity Flutter Package' to achieve this feature on your App. This package helps to know whether your device is online or offline.
Explore the pros and cons of Dio, HTTP, and GraphQL as HTTP client libraries for Flutter with real-world examples and code snippets.