• Stars
    star
    912
  • Rank 50,097 (Top 1.0 %)
  • Language
    Dart
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

✈️ A tidy utility to handle offline/online connectivity like a Boss

✈️ Flutter Offline

Format, Analyze and Test codecov pub package

A tidy utility to handle offline/online connectivity like a Boss. It provides support for both iOS and Android platforms (offcourse).

🎖 Installing

dependencies:
  flutter_offline: "^2.1.0"

⚡️ Import

import 'package:flutter_offline/flutter_offline.dart';

Add Permission to Manifest

<uses-permission android:name="android.permission.INTERNET"/>

🎮 How To Use

import 'package:flutter/material.dart';
import 'package:flutter_offline/flutter_offline.dart';

class DemoPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("Offline Demo"),
      ),
      body: OfflineBuilder(
        connectivityBuilder: (
          BuildContext context,
          ConnectivityResult connectivity,
          Widget child,
        ) {
          final bool connected = connectivity != ConnectivityResult.none;
          return new Stack(
            fit: StackFit.expand,
            children: [
              Positioned(
                height: 24.0,
                left: 0.0,
                right: 0.0,
                child: Container(
                  color: connected ? Color(0xFF00EE44) : Color(0xFFEE4400),
                  child: Center(
                    child: Text("${connected ? 'ONLINE' : 'OFFLINE'}"),
                  ),
                ),
              ),
              Center(
                child: new Text(
                  'Yay!',
                ),
              ),
            ],
          );
        },
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Text(
              'There are no bottons to push :)',
            ),
            new Text(
              'Just turn off your internet.',
            ),
          ],
        ),
      ),
    );
  }
}

For more info, please, refer to the main.dart in the example.

📷 Screenshots

🐛 Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull request are also welcome.

❗️ Note

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

🤓 Mentions

Simon Lightfoot (@slightfoot) is just awesome 👍.

⭐️ License

MIT License

More Repositories

1

flutter_spinkit

✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.
Dart
2,987
star
2

time.dart

⏰ Type-safe DateTime and Duration calculations, powered by extensions.
Dart
494
star
3

tailor_made

✄ Managing a Fashion designer's daily routine.
Dart
328
star
4

flutter_ravepay

Flutter integration for Flutterwave's Rave payment platform
Dart
59
star
5

iirc

🤔 IIRC (If I remember correctly): For keeping track of important recurring events.
Dart
48
star
6

ovavue

💸 A tidy budget overview planner.
Dart
41
star
7

rijksbook

🖼 A basic Flutter app built for educational purposes
Dart
38
star
8

pnyws

💰 Pnyws (PennyWise): An expense tracker.
Dart
34
star
9

flutter_scale_aware

🎗 Scale-based layouts with a bit more ease, powered by extensions.
Dart
25
star
10

ravepay.dart

💳 RavePay by Flutterwave Dart SDK. http://rave.flutterwave.com
Dart
21
star
11

registry.dart

🤿 A super-tiny service locator, \o/
Dart
19
star
12

nativescript-paystack

Nativescript integration for Paystack payment platform
TypeScript
16
star
13

EziNote

A simply beautiful notepad.
JavaScript
13
star
14

developer-story

StackOverflow is sunsetting the developer story feature. See https://meta.stackoverflow.com/questions/415293/sunsetting-jobs-developer-story
TypeScript
9
star
15

bunq.dart

🌈 Minimal Dart API layer for Bunq https://www.bunq.com
Dart
8
star
16

playground

Dart
8
star
17

nativescript-animate-sass

Use animate.css on your Nativescript + SASS apps
CSS
6
star
18

money.dart

💵 A currency formatting utility
Dart
6
star
19

nativescript-ng-gradient

An angular directive to add gradients to Nativescipt elements
TypeScript
6
star
20

quidpay.dart

Dart SDK for Quidpay's payment gateway
Dart
6
star
21

mfsao

⚙️ My flutter-specific analysis options
Dart
6
star
22

ngx-numeral

An Angular pipe module for interfacing the Awesome Numeraljs library.
TypeScript
4
star
23

awesome-flutter-showcase

A showcase of interesting demos written in flutter.
4
star
24

push

A minimal PHP-driven platform for rapid web application development
PHP
4
star
25

voute

A personal information vault.
Dart
3
star
26

ns-ngrx-debugger

A minimal nativescript debugger for ngrx-store & ngrx-effects
TypeScript
3
star
27

ns-ng-plugin-seed

A minimal Nativescript + Angular plugin seed
TypeScript
3
star
28

flutter_guild_demo

Dart
3
star
29

flutter_introductory_workshop

Dart
2
star
30

microservice-demos

A expedition into the world or micro services with https://github.com/zeit/micro
JavaScript
2
star
31

duck_duck_shop

Dart
2
star
32

ClinicRegistry

CSS
2
star
33

Event-Bus

A micro event emitting and management system for PHP
PHP
2
star
34

DentalRegistry

An Angular4 + NWjs patient registry software.
CSS
1
star
35

jogboms.github.io

Personal website
HTML
1
star