We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fba908 commit 3fb74a1Copy full SHA for 3fb74a1
scripts/create_env_file.dart
@@ -0,0 +1,19 @@
1
+// ignore_for_file: avoid_print
2
+
3
+import 'dart:convert';
4
+import 'dart:io';
5
6
+Future<void> main() async {
7
+ Map<String, String> env = Platform.environment;
8
9
+ final file = File('./lib/env.dart');
10
+ String? contentsInBase64 = env['ENV_DART'];
11
+ if (contentsInBase64 == null) {
12
+ print('Environment variable is empty');
13
+ return;
14
+ }
15
+ Codec<String, String> stringToBase64 = utf8.fuse(base64);
16
+ String contents = stringToBase64.decode(contentsInBase64);
17
+ await file.writeAsString(contents);
18
+ print('Done');
19
+}
0 commit comments