Coneectivity Service is for checking the internet connection using provider

Overview

Features

Coneectivity Service is for checking the internet connection using provider.

Installation

  1. Add the latest version of package to your pubspec.yaml (and rundart pub get):
dependencies:
  connectivity_service: ^0.0.3
  1. Import the package and use it in your Flutter App.
import 'package:connectivity_service/connectivity_service.dart';

Example

  1. Add the provider in mateerial app
import 'package:flutter/material.dart';
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        StreamProvider<ConnectivitySatus>(
            create: (context) =>
                ConeectivityService().connectionStatusController.stream,
            initialData: ConnectivitySatus.offline)
      ],
      child: MaterialApp(
        title: 'Flutter Application',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: const Homepage(),
      ),
    );
  }
}
  1. Then add 'NetworkSensitive' where you need.
import 'package:connectivity_service/enum/network_sensitivity.dart';
import 'package:flutter/material.dart';

class Homepage extends StatefulWidget {
  const Homepage({Key? key}) : super(key: key);

  @override
  State<Homepage> createState() => _HomepageState();
}

class _HomepageState extends State<Homepage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: NetworkSensitive(
          child:Text('Your design here'),
        ),
      ),
    );
  }
}
  1. In 'NetworkSensitive' page you can create your own design on the offline section. For now it is a simple text 'No Internet!' but you can design here anything.
You might also like...

Simple generative arts created using Flutter

Simple generative arts created using Flutter

Flutter Generative Art Try it out on DartPad Simple Generative Art created using Flutter. Watch the full video on YouTube to know how to build it from

Aug 11, 2022

A very basic prototype of macros using build_runner

Description This is a basic prototype for 3 phase macros using package:build. The general idea is that macros run in 3 different phases, and each phas

Dec 14, 2022

An application built using flutter that works as destiny checker, whether our mind wish is as we desire or not with 8 different option.

magic_8_ball_utter A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you s

Feb 3, 2022

An application built using Flutter that holds a static personal/professional informations related to me in the form of card.(Digital Visiting Card)

mi_card_flutter A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Feb 3, 2022

Dart port for artwork-extractor using FFI

A simple library to extract & save artwork of a 🎵 music/audio file. This library is using a artwork-extractor library by alexmercerind. It is super s

Feb 23, 2022

An auto mapper for Dart. It allows mapping objects of different classes automatically and manually using JSON serialization.

AutoMapper for Dart An auto mapper for Dart. It allows mapping objects of different classes automatically and manually using JSON serialization. Examp

Aug 24, 2022

A flutter package with classes to help testing applications using the canvas

Canvas test helpers MockCanvas is a utility class for writing tests for canvas operations. It supports the same API as the regular Canvas class from d

Jan 31, 2022

Volt is a wrapper over the Revolt API for easily writing bots using the Dart language.

Volt is a wrapper over the Revolt API for easily writing bots using the Dart language. It is currently in active development so not all of the functionality has yet been implemented.

Dec 13, 2022

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Nov 9, 2022
Owner
Mahmudul Hasan Shifat
Mahmudul Hasan Shifat
A Dart package which supports checking if a current package is up-to-date.

pub_updater A Dart package which enables checking whether packages are up to date and supports updating them. Intended for use in CLIs for prompting u

Very Good Open Source 47 Oct 27, 2022
For test background service try to run ios

workmanager_example Demonstrates how to use the workmanager plugin. Getting Started This project is a starting point for a Flutter application. A few

Taylan YILDIZ 2 Sep 20, 2021
FaaS (Function as a service) framework for writing portable Dart functions

Functions Framework for Dart This is a community-supported project, meaning there is no official level of support. The code is not covered by any SLA

Google Cloud Platform 485 Dec 26, 2022
This is a simple class to package up and send requests to the Kroki.io web service.

Kroki.dart This is a simple class to package up and send requests to the Kroki.io web service. A live editor to editing diagrams that Kroki supports c

Tim Maffett 1 Jun 8, 2022
Collection of should have StateNotifiers for combining with Riverpod/Provider

Collection of custom StateNotifiers. Riverpod / StateNotifierProvider or Provider / LocatorMixin

Mehmet Esen 2 Feb 27, 2022
An android application built using Flutter that computes the Body Mass Index of person and suggestion to carry ,by taking Inputs (Weight, Height, and Age), Built using Flutter

BMI Calculator ?? Our Goal The objective of this tutorial is to look at how we can customise Flutter Widgets to achieve our own beautiful user interfa

dev_allauddin 7 Nov 2, 2022
A Dart package to web scraping data from websites easily and faster using less code lines.

Chaleno A flutter package to webscraping data from websites This package contains a set of high-level functions that make it easy to webscrap websites

António Nicolau 30 Dec 29, 2022
Notes app using flutter, firebase and cloud firestore

notes A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Sidheshwar S 8 Aug 10, 2022
A BMI calculator application using Flutter.

BMI Calculator Purpose Maintaining a healthy weight is important for overall health and can help to prevent and control many diseases and conditions.

Srijan Kumar Gupta 3 Apr 21, 2022
Rocket is a parsing framework for parsing binary data structures using efficient parsing algorithms

rocket Version 0.1.10 (BETA) Rocket is a parsing framework for parsing binary data structures using efficient parsing algorithms. Breaking change: The

null 5 Dec 5, 2021