periodic

A periodic widget (and dialog) to choose a recurring pattern.

pub Project Status: Active License: MIT style: effective dart

Getting Started

Add the dependency:

dependencies:
  flutter:
    sdk: flutter
  periodic: ^1.0.0+1

Periodic Widget

Create a new periodic widget:

@override
Widget build(BuildContext context) {
  return Periodic();
}

To get result, you must pass a PeriodicController to the widget.

final _controller = PeriodicController()
...

Widget build(BuildContext context) {
  return Periodic(
    controller: _controller,
  );
}
...

print(_controller.current);

Configuration

You can pass a PeriodicConfig to the widget to modify how it looks.

Widget build(BuildContext context) {
  return Periodic(
    config: PeriodicConfig(
      frequencyMenuColor: Colors.blue,
      weekConfig: PeriodicItemConfig(
        selectedColor: Colors.blue,
        unselectedColor: Colors.white
      )
    ),
  );
}

Periodic dialog

A custom dialog that has a Periodic widget as content.

showPeriodicDialog(context)

As any other Dialog, returns a Future with a PeriodicData.

final data = showPeriodicDialog(context);
print(data); // PeriodicData

Libraries

periodic