Reputation: 1935
Is it possible to embed resource files in the Dart2Native binary? I have an https server where I wanted to embed the server TLS certs (self-signed) along with the binary. I am using the following code to read the resource data.
var cert = await Resource("lib/certs/cert.pem").readAsString(encoding: utf8);
var key = await Resource("lib/certs/cert.key").readAsString(encoding: utf8);
But the generated binary doesn't include the resource files and always looks for the data under lib/certs location. One trick is to copy/paste that content as a dart string literal, but not very useful for binary or large data.
Upvotes: 2
Views: 283