internet_connection_checker_plus 2.5.1 copy "internet_connection_checker_plus: ^2.5.1" to clipboard
internet_connection_checker_plus: ^2.5.1 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(),
        ),
      ),
    );
  }
}
296
likes
160
pub points
99%
popularity

Publisher

verified publisheroutdatedguy.rocks

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