downloadMultipleFile method

  1. @override
Future<String?> downloadMultipleFile({
  1. required List<String?> urls,
  2. required List<String> fileNames,
  3. required Function response,
  4. bool? saveToPhoto = false,
  5. bool? showToastAndroid = false,
})
override

Implementation

@override
Future<String?> downloadMultipleFile({
  required List<String?> urls,
  required List<String> fileNames,
  required Function response,
  bool? saveToPhoto = false,
  bool? showToastAndroid = false
}) async {
  try {
    final result = await downloadMultipleFileMethodChannel.invokeMethod<String>(
        downloadMultipleFileMethod, { 'urls': urls,
      'file_names': fileNames,
      'save_to_photo': saveToPhoto,
      'show_toast': showToastAndroid
    });
    response(result);
    return result;
  } on PlatformException catch (e) {
    debugPrint("PlatformException: ${e.code} - ${e.message}");
    response(e);
    return "PlatformException: ${e.code} - ${e.message}";
  } catch (e) {
    response(e);
    return "Exception: $e";
  }
}