connectivity_watcher 1.0.0 copy "connectivity_watcher: ^1.0.0" to clipboard
connectivity_watcher: ^1.0.0 copied to clipboard

Discover network connectivity changes throught the app with your own custom no internet widget.

example/lib/main.dart

import 'package:connectivity_watcher/network_check.dart';
import 'package:example/no_internet.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

 
  @override
  Widget build(BuildContext context) {
    return ConnectivityWatcherAppWrapper(
      noInternetWidget: CustomNoInternet(), // Place your custom no internet Widget
      app: MaterialApp(
          navigatorKey: ConnectivityWatcher.contextKey,
          debugShowCheckedModeBanner: false,
          title: 'Connectivity_Watcher',
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: TestScreen()),
    );
  }
}

class TestScreen extends StatefulWidget {
  const TestScreen({super.key});

  @override
  State<TestScreen> createState() => _TestScreenState();
}

class _TestScreenState extends State<TestScreen> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.red,
      body: SafeArea(
        child: Container(
            alignment: Alignment.center,
            ),
      ),
    );
  }
}
34
likes
0
pub points
65%
popularity

Publisher

verified publisherthezerone.com

Discover network connectivity changes throught the app with your own custom no internet widget.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, internet_connection_checker, provider, shimmer

More

Packages that depend on connectivity_watcher