I'm trying to read data from TXT file but somthing goes wrong. There is a code
import 'dart:async'
import 'dart:io';
void main(){
File('file.txt').readAsString().then((String contents){
print(contents);
});
}
This is code From official documentation.also I tried change path to my file in File('') like (assets/file.txt) but stil nothing work. I getting this error after starting program
Error: Unsupported operation: _Namespace
I know that i need to add assets at pbuspec.yaml file, i did it. also when i using rootBundle from services.dart, to read this file.txt, everything is working fine and i can read data from it.