no_internet_connection_widget 1.0.1 copy "no_internet_connection_widget: ^1.0.1" to clipboard
no_internet_connection_widget: ^1.0.1 copied to clipboard

An easy no internet connection widget

NoInternetConnectionWidget #

A "No Internet Connection" widget is a graphical user interface (GUI) element or notification that appears on a device's screen to inform users that their device is currently not connected to the internet. This widget typically displays a distinctive icon or symbol along with a message indicating the absence of an internet connection. Its purpose is to alert users to the lack of network connectivity, helping them understand why certain online features or services may not be accessible. Users may encounter this widget in various devices, such as smartphones, tablets, or computers, where it serves as a visual prompt to troubleshoot network issues or seek a stable internet connection.

Installation #

Add the following line to pubspec.yaml:

  dependencies:
    no_internet_connection_widget: 1.0.1

Usage/Examples #

  @override
  void initState() {
    super.initState();
    // start listening the connectivity changes
    noInternetController.listen();
  }

  
  @override
  Widget build(BuildContext context) {
    return CheckInternetConnection(
      whenOffline: const Text("No Internet connection"),// optional
      child: Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: Text(widget.title),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              const Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.headlineMedium,
              ),
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          tooltip: 'Increment',
          child: const Icon(Icons.add),
        ),
      ),
    );
  }

2
likes
120
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

An easy no internet connection widget

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

connectivity_plus, cupertino_icons, flutter, rxdart

More

Packages that depend on no_internet_connection_widget