banner_status_internet_connection 0.0.6 copy "banner_status_internet_connection: ^0.0.6" to clipboard
banner_status_internet_connection: ^0.0.6 copied to clipboard

A package to show internet connection status dynamically with customizable styles and text.

banner_status_internet_connection #

A Flutter package that displays a banner indicating the internet connection status. This banner is shown when there is no internet access and provides a visual cue to the user.

Features #

  • Displays a banner when there is no internet connection.
  • Easy to integrate with your existing Flutter applications.
  • Customizable message and styles.

Installation #

Add the package to your pubspec.yaml file:

dependencies:
  banner_status_internet_connection: ^0.0.4  # Replace with the latest version

Run the following command to install the package:

flutter pub get

Usage #

Importing the Package #

To use the InternetConnectionBanner widget, import it into your Dart file:

import 'package:banner_status_internet_connection/widgets/internet_connection_banner.dart';

Creating the Banner #

You can create the banner using the InternetConnectionBanner widget. Here’s an example of how to implement it in your Flutter application:

import 'package:flutter/material.dart';
import 'package:banner_status_internet_connection/widgets/internet_connection_banner.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Internet Connection Banner Example')),
        body: InternetConnectionBanner(
          params: InternetConnectionBannerParams(
            message: 'WAITING_RED'.tr,
            backgroundColor: context.appTheme.colors.secondary,
            messageStyle: context.appTheme.style.h3.copyWith(
              color: Colors.white,
              decoration: TextDecoration.none,
            ),
          ),
          child: Center(child: Text('Main Content Area')),
        ),
      ),
    );
  }
}

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

License #

This project is licensed under the MIT License - see the LICENSE file for details.

2
likes
145
points
40
downloads

Publisher

unverified uploader

Weekly Downloads

A package to show internet connection status dynamically with customizable styles and text.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, internet_connection_checker_plus, provider

More

Packages that depend on banner_status_internet_connection