on_connectivity_widget 1.0.2 copy "on_connectivity_widget: ^1.0.2" to clipboard
on_connectivity_widget: ^1.0.2 copied to clipboard

discontinued
outdated

Flutter Package used to listen network connection and show a custom message to application.

example/lib/main.dart

/*
Author: Lucas Josino
Github: https://github.com/LucasPJS
Package: on_connectivity_widget
Homepage: https://github.com/LucasPJS/on_connectivity_widget
Copyright: © 2021, Lucas Josino. All rights reserved.
License: https://github.com/LucasPJS/on_connectivity_widget/blob/main/LICENSE
*/

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("OnConnectivityExample"),
        ),
        body: OnConnectivityWidget(
          animationDuration: Duration(seconds: 1),
          messageDuration: Duration(seconds: 2),
          position: PositionType.BOTTOM,
          showNoneUntilOnline: true,
          messageDurationWhenOnline: Duration(seconds: 2),
          animationType: Curves.bounceInOut,
          cancelInitState: false,
          wifiWidget: Container(
            height: 60,
            width: double.infinity,
            color: Colors.green,
            child: Center(child: Text("Wifi")),
          ),
          mobileWidget: Container(
            height: 60,
            width: double.infinity,
            color: Colors.blue,
            child: Center(child: Text("Mobile")),
          ),
          noneWidget: Container(
            height: 60,
            width: double.infinity,
            color: Colors.red,
            child: Center(child: Text("None")),
          ),
          //customAnimation: null,
          //customPosition: null,
        ),
      ),
    );
  }
}
9
likes
0
pub points
24%
popularity

Publisher

verified publisherlucasjosino.com

Flutter Package used to listen network connection and show a custom message to application.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

connectivity_plus, flutter, on_toast_widget

More

Packages that depend on on_connectivity_widget