ots 0.0.1+1 copy "ots: ^0.0.1+1" to clipboard
ots: ^0.0.1+1 copied to clipboard

outdated

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

ots #

An 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),
      ),

      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.

12
likes
0
pub points
75%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

connectivity, flutter

More

Packages that depend on ots