flutter_dotenv icon indicating copy to clipboard operation
flutter_dotenv copied to clipboard

Multiline is not supported

Open rsov opened this issue 2 years ago • 1 comments

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

rsov avatar Jan 19 '24 00:01 rsov

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.

java-james avatar Oct 12 '24 00:10 java-james