Created
February 12, 2020 08:32
-
-
Save momshaddinury/a1aafd430b35e53b85525aabb337c367 to your computer and use it in GitHub Desktop.
This file contains 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
getAsset() async { | |
print('Test: ${getAssets.noticeList}'); //DEBUG | |
String notice; | |
for (notice in getAssets.noticeList) { | |
assetResponse = await http.get(noticeDownloadURL + notice); | |
documentDirectory = await getApplicationDocumentsDirectory(); | |
firstPath = documentDirectory.path + "/notices"; | |
filePathAndName = documentDirectory.path + '/notices/$notice'; | |
} | |
//await Directory(firstPath).create(recursive: true); | |
File file2 = new File(filePathAndName); | |
file2.writeAsBytesSync(assetResponse.bodyBytes); | |
setState(() { | |
print('check2'); | |
imageData = filePathAndName; | |
dataLoaded = true; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment