Created
June 4, 2021 22:06
-
-
Save VB10/a5f06b21552f5856b2e2ef86ef89a96f 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('Cache Model In File', () async { | |
final model = ItemModel(id: 1345); | |
final directory = await getApplicationDocumentsDirectory(); | |
await Directory('${directory.path}').create(); | |
await Directory('${directory.path}/vb2').create(); | |
final path = '${directory.path}/vb2/${model.title}.jso'; | |
final file = File(path); | |
final fileWithData = await file.writeAsString(model.toString()); | |
expect(await fileWithData.exists(), true); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment