getLatestInvocationTime method

Future<DateTime?> getLatestInvocationTime(
  1. String taskName
)

Get the DateTime when this task was last invoked successfully.

This time is only known if the invocation was previously cached via cacheTaskInvocation.

Implementation

Future<DateTime?> getLatestInvocationTime(String taskName) async {
  final file = _taskFile(taskName);
  if (await file.exists()) {
    return await file.lastModified();
  }
  return null;
}