Load Flutter runtime config from Vault
Build and deploy Flutter Web / build (push) Successful in 6m25s
Build and deploy Flutter Web / build (push) Successful in 6m25s
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
export 'runtime_config_stub.dart'
|
||||
if (dart.library.js_interop) 'runtime_config_web.dart';
|
||||
@@ -0,0 +1,3 @@
|
||||
String mapboxAccessToken() => '';
|
||||
|
||||
String mapboxStyle() => '';
|
||||
@@ -0,0 +1,13 @@
|
||||
import 'dart:js_interop';
|
||||
|
||||
@JS('__MAPFLOW_CONFIG__')
|
||||
external _MapflowConfig? get _config;
|
||||
|
||||
extension type _MapflowConfig(JSObject _) implements JSObject {
|
||||
external JSString? get mapboxAccessToken;
|
||||
external JSString? get mapboxStyle;
|
||||
}
|
||||
|
||||
String mapboxAccessToken() => _config?.mapboxAccessToken?.toDart ?? '';
|
||||
|
||||
String mapboxStyle() => _config?.mapboxStyle?.toDart ?? '';
|
||||
Reference in New Issue
Block a user