1

In my app i add pdf download functionality using flutter_downloader package.

below is my Function to download a file.

static Future<String?> downloadPdf(String path, String downloadLink) async {
    final taskId = await FlutterDownloader.enqueue(
      url: downloadLink,
      savedDir: path,
      showNotification: true,
      openFileFromNotification: true,
      saveInPublicStorage: true,
    );

    return taskId;
  }

when i download any file then i got notification but in notification it shows file path as below image.

enter image description here

in above image it shows link of file, so how i can display other thing like your file have downloaded in the place of file link?

Note: - my download api link is based on id not a file name for example - "api/xyz/xyz/33".

Please help me.

thank you.

Dhaval Chaudhari
  • 417
  • 8
  • 22

1 Answers1

1

Open your-app/android/app/src/main/res/values/strings.xml if you don't have strings.xml just create it and add these strings:

<resources>
  <string name="flutter_downloader_notification_started">Your notification_started message</string>
  <string name="flutter_downloader_notification_in_progress">Your notification_in_progress message</string>
  <string name="flutter_downloader_notification_canceled">Your notification_canceled message</string>
  <string name="flutter_downloader_notification_failed">Your notification_failed message</string>
  <string name="flutter_downloader_notification_complete">...</string>
  <string name="flutter_downloader_notification_paused">...</string>
  ...
</resources>
Taym95
  • 2,331
  • 13
  • 14