internet_connection_checker_plus 2.6.0 copy "internet_connection_checker_plus: ^2.6.0" to clipboard
internet_connection_checker_plus: ^2.6.0 copied to clipboard

A Flutter package to check your internet connection with subsecond response times, even on mobile networks!

example/lib/main.dart

// Flutter Packages
import 'package:flutter/material.dart';

// Pages
import 'pages/custom_success_criteria.dart';
import 'pages/custom_uris.dart';
import 'pages/listen_once.dart';
import 'pages/listen_to_stream.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Internet Connection Checker Plus Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({super.key});

  final pages = {
    'Listen Once': const ListenOnce(),
    'Listen to Stream': const ListenToStream(),
    'Custom URIs': const CustomURIs(),
    'Custom Success Criteria': const CustomSuccessCriteria(),
  };

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Internet Connection Checker Plus Demo'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: pages.entries.map((entry) {
            return Padding(
              padding: const EdgeInsets.all(10.0),
              child: ElevatedButton(
                onPressed: () => Navigator.of(context).push(
                  MaterialPageRoute(
                    builder: (context) => entry.value,
                  ),
                ),
                child: Text(entry.key),
              ),
            );
          }).toList(),
        ),
      ),
    );
  }
}
317
likes
160
points
122k
downloads

Publisher

verified publisheroutdatedguy.rocks

Weekly Downloads

A Flutter package to check your internet connection with subsecond response times, even on mobile networks!

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

connectivity_plus, flutter, http

More

Packages that depend on internet_connection_checker_plus