ots 0.0.1+2

Flutter Android iOS

A package for showing loading indicators, notifications, dialogs, internet connectivity updates, Over the Screen easily.

ots #

A widget that can show loaders, notifications, internet connectivity changes as Overlay.

Example

Demo #

Internet connectivity changes Loader Notification

Installation #

dependencies:
  flutter:
    sdk: flutter
  ...

  ots:
    git:
      url: git://github.com/fayaz07/ots.git

How to use #

void main() => runApp(
      MyApp(),
    );

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return OTS(
      showNetworkUpdates: true,
      persistNoInternetNotification: false,

      /// pass your custom loader here
      loader: CircularProgressIndicator(
        valueColor: AlwaysStoppedAnimation<Color>(Colors.red),
      ),

      // if you wish to show the internet toast during startup
      showNetworkStatusDuringInit: true,

      child: MaterialApp(
      title: 'OTS Test',
        home: Home(),
      ),
    );
  }
}

By default, loader is set to CircularProgressIndicator for Android and CupertinoActivityIndicator for iOS.

Showing and hiding a loader

showLoader(
  isModal: true,
);
/// Your network operation
hideLoader();

Note: isModal stops user from interacting with the screen

Showing and hiding a notification

showNotification(
  title: 'Test',
  message: 'Hello, this is notification',
  backgroundColor: Colors.green,
  autoDismissible: true,
  notificationDuration: 2500,
);

// use only if `autoDismissible: false`
hideNotification();

Note: Notifications are automatically dismissed after the specified duration if autoDismissible is set to true.

2
likes
80
pub points
59%
popularity

A package for showing loading indicators, notifications, dialogs, internet connectivity updates, Over the Screen easily.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

fayazfz07@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

connectivity, flutter

More

Packages that depend on ots