flutter_dotenv
flutter_dotenv copied to clipboard
Multiline is not supported
According to dotenv README there should be support for multiple lines. However when I try, it only loads the first one.
.env
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
ASDASDASDASDASD
-----END PRIVATE KEY-----
"
Code:
Future main() async {
await dotenv.load(fileName: '.env');
print(dotenv.get("PRIVATE_KEY"));
}
Output:
flutter: "-----BEGIN PRIVATE KEY-----
I believe the bug is coming from this line: https://github.com/java-james/flutter_dotenv/blob/de801661ffdc20526e91ca3f1d716897b0b8141a/lib/src/dotenv.dart#L109
Thanks for raising this issue. I think it would be useful to align with the readme you have linked given it's the original library this was forked from!
I will try find the time to implement this. Otherwise, feel free to contribute with the PR I will be happy to merge and release this feature.