Line data Source code
1 : /// Annotation for the native_workmanager_gen code generator.
2 : ///
3 : /// Applied to a top-level function to mark it as a background worker callback.
4 : class WorkerCallback {
5 : /// The unique ID for this worker callback.
6 : final String id;
7 :
8 : /// Optional: The type of the input parameter for this worker.
9 : ///
10 : /// If provided, the generator will attempt to create a type-safe enqueue
11 : /// wrapper for this worker. The type should have a `toMap()` method or be
12 : /// a primitive type.
13 : final Type? inputType;
14 :
15 : /// Creates a [WorkerCallback] with the given [id] and optional [inputType].
16 0 : const WorkerCallback(this.id, {this.inputType});
17 : }
|