E/flutter (13503): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: FileSystemException: Cannot open file, path = 'lib/certs/ca.pem' (OS Error: No such file or directory, errno = 2)
SecurityContext clientContext = new SecurityContext()
..setTrustedCertificates('assets/certs/ca.pem');
var client = new HttpClient(context: clientContext);
var request = await client.getUrl(
Uri.parse('192.168.0.132', 10000));
var response = await request.close();
assets:
- assets/
- assets/certs/
all the files are inside lib folder and inside that lib folder there is certs folder and inside the certs folder all the pem and certificates are there and i need to use it for encryption. it cannot find it but in the actual main function in flutter. if i read file from a different dart code file then it is working but i want that in my project.enter image description here