From d53eb386f5170ae667c1b0cc0f2659611bb65971 Mon Sep 17 00:00:00 2001 From: abishop-jac <88761286+abishop-jac@users.noreply.github.com> Date: Wed, 11 Aug 2021 14:56:13 +0930 Subject: [PATCH] Update README.md Include a comment in example .env file, to show comment syntax. Fix documentation of get method --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d3a7b45..0997d7b 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ FOO=foo BAR=bar FOOBAR=$FOO$BAR ESCAPED_DOLLAR_SIGN='$1000' +# This is a comment ``` > Note: If deploying to web server, ensure that the config file is uploaded and not ignored. (Whitelist the config file on the server, or name the config file without a leading `.`) @@ -164,10 +165,10 @@ Future main() async { String foo = dotenv.get('VAR_NAME'); // Or with fallback. - String bar = dotenv.get('MISSING_VAR_NAME', fallback; 'sane-default'); + String bar = dotenv.get('MISSING_VAR_NAME', fallback: 'sane-default'); // This would return null. - String? baz = dotenv.get('MISSING_VAR_NAME', fallback; null); + String? baz = dotenv.maybeGet('MISSING_VAR_NAME', fallback: null); } ```