0 purchases
download pad
download_pad #
This is a flutter package to download files from url. All you need is to pass the file url, file name that you want to save as, and the download directory where you want to save the file.
Github: https://github.com/evanemran/flutter_timer_widget
Parameters #
url - of the file
fileName - a name that you want to save as the downloaded file
dir - the directory where you want to save the file
Don't forget to add these permissions to your manifest file.
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
copied to clipboard
How to Use #
Step 1:
Add this line to your dependencies:
download_pad: ^0.0.1
copied to clipboard
import 'package:download_pad/download_pad.dart';
copied to clipboard
Step 1:
Call the DownloadPad class method downloadFile() and pass the parameters. Here is a quick example:
void startDownload() async {
String url = "https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg";
Directory path = await getApplicationDocumentsDirectory();
String dir = path.path;
DownloadPad.downloadFile(url, "my_file", dir);
}
copied to clipboard
Conclusion #
This is an initial release of the package. If you find any issue please let me know I will fix it accordingly.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.