Created
July 1, 2021 10:07
-
-
Save perymerdeka/eef62944c248f7d9a0286c33e512ad58 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
import 'dart:convert'; | |
import 'dart:io'; | |
void main() async { | |
assetsGenerator(); | |
} | |
void assetsGenerator({String assetsDir='/assets/images/'}) async { | |
var assetsPaths = Directory(Directory.current.path + assetsDir); | |
try { | |
var assetsList = assetsPaths.list(); | |
await assetsList.forEach((element) { | |
String imageName = element.path.split('/').last; | |
String imagePath = element.path.split('/')[6] + '/' + element.path.split('/')[7] + '/' + imageName; | |
print(imagePath); | |
}); | |
} catch (error) { | |
print(error.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment