internet_connectivity_check 0.0.1 copy "internet_connectivity_check: ^0.0.1" to clipboard
internet_connectivity_check: ^0.0.1 copied to clipboard

This package provides the info about internet connectiviy.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:internet_connectivity_check/internet_connectivity_check.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      home: HomeScreen(),
    );
  }
}

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

  @override
  State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  @override
  void initState() {
    super.initState();
    checkCon();
  }

  checkCon() async {
    bool connection = await checkInternetStatus();

    print(connection);
  }

  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;

    return Scaffold(
      body: SafeArea(
          child: SizedBox(
        width: size.width,
        height: size.height,
        child: const Column(
          children: [],
        ),
      )),
    );
  }
}
2
likes
125
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

This package provides the info about internet connectiviy.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on internet_connectivity_check