poller

A custom poller for Flutter apps to use to periodically execute a function.

Usage

Create a poller. Start it. If desired, pause, resume, or stop it altogether. You can also check on its status to see if it is paused or stopped.

import 'package:poller/poller.dart';

final Poller poller = new Poller(seconds: 3, callback: () {
  // callback function
});

poller.start();

poller.pause();

poller.resume();

poller.stop();

if (poller.isPaused) {
  // poller is paused
}

if (poller.isStopped) {
  // poller is stopped
}

Example

See example/main.dart for usage example.

Example GIF

Getting Started

Use this package as a library.

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
  poller: ^1.1.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:poller/poller.dart';

Libraries

poller