i was trying to read a .txt file (from assets) in items of a list, so i was doing this:
list.add(await rootBundle.loadString('assets/jolo.txt'));
It takes the whole document and put it in 'data', but at showing the list is empty.
So i tried something else:
new File('assets/jolo.txt')
.openRead()
.transform(utf8.decoder)
.transform(new LineSplitter())
.forEach((l) => list.add(Item(name: l)));
but that throws me an error: FileSystemException: Cannot open file, path = 'assets/jolo.txt' (OS Error: No such file or directory, errno = 2)
What can i do? I'm using plain text for putting every line into an item for show the whole list