get method

  1. @override
FutureOr<BackgroundTaskInfo?> get(
  1. String taskId
)
override

Implementation

@override
FutureOr<BackgroundTaskInfo?> get(String taskId) {
  try {
    final value = box.get(taskId);
    if (value == null) return null;
    if (value is! Map<String, dynamic>) throw Exception("Value stored is not of type Map<String,dynamic>. value : $value");
    return BackgroundTaskInfo.fromMap(value);
  } on Exception catch (e) {
    debugPrint("BackgroundTaskCache get exception $e");
    rethrow;
  } on Error catch (e) {
    debugPrint("BackgroundTaskCache get error $e");
    rethrow;
  }
}