bloc_connectivity 0.0.2 copy "bloc_connectivity: ^0.0.2" to clipboard
bloc_connectivity: ^0.0.2 copied to clipboard

This is a Flutter package used to wrap your application with the NetworkChecker Widget to continously check the network connectivity using Bloc.

Example for bloc_connectivity #

This example demonstrates the usage of the NetworkChecker widget from the bloc_connectivity package.

Getting Started #

  1. Install the package by adding it to your pubspec.yaml file:
dependencies:
  bloc_connectivity: ^1.0.0
  1. Import the package in your Dart code:

import 'package:bloc_connectivity/bloc_connectivity.dart';
Use the NetworkChecker widget to handle network connectivity in your app:
dart
Copy code
import 'package:flutter/material.dart';
import 'package:bloc_connectivity/bloc_connectivity.dart';

void main() {
  runApp(
    NetworkChecker(
      child: MyApp(),
      networkOffDialog: AlertDialog(
        title: Text('Network Offline'),
        content: Text('Please check your internet connection.'),
        actions: [
          TextButton(
            onPressed: () {
              // Handle retry action
            },
            child: Text('Retry'),
          ),
        ],
      ),
    ),
  );
}

// ... rest of your code ...
  1. Feel free to adjust the structure based on your preferences and the complexity of your documentation and example.
3
likes
130
points
92
downloads

Publisher

unverified uploader

Weekly Downloads

This is a Flutter package used to wrap your application with the NetworkChecker Widget to continously check the network connectivity using Bloc.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

bloc, bloc_test, connectivity_plus, equatable, flutter, flutter_bloc, mockito

More

Packages that depend on bloc_connectivity