Search packages, repositories and app categories

Package detailsv0.6.2

cron

A time-based job scheduler similar to cron. Run tasks periodically at fixed times or intervals.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
62.3K
Likes
601
Pub points
160

Install package

flutter pub add cron

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The cron package is a time-based job scheduler for Flutter applications, enabling developers to run tasks at specific times or intervals, similar to the traditional Unix cron system. It supports scheduling on all major platforms including Android, iOS, Web, macOS, Windows, and Linux. Ideal for automating recurring operations like data sync, notifications, or background processing, it provides a simple API to define and manage scheduled jobs. The package is lightweight and integrates seamlessly into Flutter apps.

Use cases

  • Automated data synchronization
  • Scheduled notifications
  • Background task execution
  • Periodic cache cleanup
  • System health checks

Key features

  • Supports cron-style syntax
  • Cross-platform compatibility
  • Simple API for scheduling
  • Runs in background
  • Handles time zone awareness

Suitable for

  • Apps needing periodic maintenance
  • Real-time data update systems
  • Notification-driven applications
  • Background processing workflows
  • IoT device management

Considerations

  • Requires proper handling of app lifecycle
  • May consume resources if overused
  • Time zone configuration needed for global users
  • Not suitable for high-precision timing
  • Background execution limits on some platforms

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Cron

Run tasks periodically at fixed times or intervals.

pub package

Usage

A simple usage example:

import 'package:cron/cron.dart';

void main() {
  final cron = Cron();

  cron.schedule(Schedule.parse('*/3 * * * *'), () async {
    print('every three minutes');
  });

  cron.schedule(Schedule.parse('8-11 * * * *'), () async {
    print('between every 8 and 11 minutes');
  });
}

Cron parser

You can easily create and parse cron format:

import 'package:cron/cron.dart';

void main() {
  print(Schedule.parse('3-5 * * * *').minutes); // [3, 4, 5]
  
  print(Schedule(hours: 12, minutes: 25, weekdays: [2, 3])
      .toCronString()); // 25 12 * * 2,3
}

Links

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

Rankings