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 6b775ea commit 61be634Copy full SHA for 61be634
1 file changed
lib/app/utils/flavor.dart
@@ -23,7 +23,13 @@ enum Flavor {
23
24
static Flavor _current =
25
parse(appFlavor ?? '') ??
26
- parse(String.fromEnvironment('OUISYNC_FLAVOR')) ??
+ // Note the `const` is crucial here. According to the [docs]
27
+ // (https://api.flutter.dev/flutter/dart-core/String/String.fromEnvironment.html):
28
+ //
29
+ // > This constructor is only guaranteed to work when invoked as const. It may work as a
30
+ // > non-constant invocation on some platforms which have access to compiler options at
31
+ // > run-time, but most ahead-of-time compiled platforms will not have this information.
32
+ parse(const String.fromEnvironment('OUISYNC_FLAVOR')) ??
33
production;
34
35
static Flavor get current => _current;
0 commit comments