cron_generator_annotations 0.0.2 copy "cron_generator_annotations: ^0.0.2" to clipboard
cron_generator_annotations: ^0.0.2 copied to clipboard

A very easy way to generate crons, using a class to consolidate all your cron logic.

example/cron_generator_annotations_example.dart

import 'package:cron_generator_annotations/cron_generator_annotations.dart';

part 'cron_generator_annotations_example.g.dart';

class MyCron = MyCronTest with _$MyCronCron;

@CronBase()
class MyCronTest {
  @CronGenMethod(minutes: '1-2')
  void myCronStuffs(int arg, {required int requiredArg, double? optionalArg}) {
    print('myMethodTestWithPositioneds original $arg requiredArg $requiredArg');
  }
}

Future<void> main() async {
  final cronObj = MyCron();
  cronObj.myCronStuffs(1, requiredArg: 2);

  await Future<void>.delayed(const Duration(minutes: 10));

  await cronObj.close();
}
2
likes
160
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A very easy way to generate crons, using a class to consolidate all your cron logic.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

cron, meta

More

Packages that depend on cron_generator_annotations