retrieveLostData static method

Future<void> retrieveLostData(
  1. dynamic picker, {
  2. required dynamic onLoaded(
    1. File?
    ),
  3. dynamic onError(
    1. String
    )?,
})

Implementation

static Future<void> retrieveLostData(
  final picker, {
  required Function(File?) onLoaded,
  Function(String)? onError,
}) async {
  final LostData response = await picker.getLostData();
  if (response.isEmpty) {
    return;
  }

  if (response.file == null) {
    onError!(response.exception!.code);
    return;
  }

  if (response.type == RetrieveType.video) {
    return;
  }

  onLoaded(File(response.file!.path));
}