flutter_offline 0.1.0 copy "flutter_offline: ^0.1.0" to clipboard
flutter_offline: ^0.1.0 copied to clipboard

outdated

Handle offline/online connectivity in Flutter like a Boss.

✈️ Flutter Offline #

pub package

Handle offline/online connectivity in Flutter like a Boss. Ample support for both iOS and Android platforms.

🎖 Installing #

dependencies:
  flutter_offline: "^0.1.0"

⚡️ Import #

import 'package:flutter_offline/flutter_offline.dart';

🎮 How To Use #

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

class OfflineDelegate extends OfflineBuilderDelegate {
  @override
  Widget builder(BuildContext context, bool state) {
    return new Stack(
      fit: StackFit.expand,
      children: [
        Positioned(
          height: 24.0,
          left: 0.0,
          right: 0.0,
          child: Container(
            color: state ? Color(0xFF00EE44) : Color(0xFFEE4400),
            child: Center(
              child: Text("${state ? 'ONLINE' : 'OFFLINE'}"),
            ),
          ),
        ),
        Center(
          child: new Text(
            'Yay!',
          ),
        ),
      ],
    );
  }
}

class DemoPage extends StatelessWidget {
  const DemoPage({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("Offline Demo"),
      ),
      body: OfflineBuilder(
        delegate: new OfflineDelegate(),
      ),
    );
  }
}

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.

⭐️ License #

MIT License

585
likes
0
pub points
97%
popularity

Publisher

verified publisherogbomo.com

Handle offline/online connectivity in Flutter like a Boss.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

connectivity, flutter

More

Packages that depend on flutter_offline