Created
May 30, 2021 23:05
-
-
Save VB10/9873096e05c08a9b6b555f6e7904ff12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test('Fetch Pdf And Cache', () async { | |
final response = await manager.downloadFileSimple('http://www.africau.edu/images/default/sample.pdf', null); | |
final directory = await getApplicationDocumentsDirectory(); | |
await Directory('${directory.path}').create(); | |
await Directory('${directory.path}/vb2').create(); | |
final path = '${directory.path}/vb2/1.pdf'; | |
final file = File(path); | |
final fileWithData = await file.writeAsBytes(response.data!); | |
expect(await fileWithData.exists(), true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment