CloudProperties class
Sensitive values (API keys, secrets) and cloud operations (proxies, secureOps).
Reads from the shared config map loaded by AppProperties. Call init after AppProperties loads the JSON.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- isSecureMode ↔ bool
-
Whether config was loaded from Cloud Functions (secrets are server-side).
getter/setter pair
- serviceAccount ↔ dynamic
-
Service account JSON (mobile only).
getter/setter pair
Static Methods
-
aiProxy(
{String provider = 'openrouter', String? model, List< Map< ? messages, int maxTokens = 2048, String? query}) → Future<String, dynamic> >Map< String, dynamic> ?> - Calls secureOps Cloud Function to proxy AI API calls (OpenRouter, Brave).
-
callSecureOps(
Map< String, dynamic> data) → Future<Map< String, dynamic> > - Calls secureOps. On web, uses secureOpsWeb (HTTP with CORS). On mobile, uses the callable secureOps via Firebase SDK.
-
getBraveKey(
) → String -
getGeminiApiKey(
) → String -
getGoogleApiKey(
) → String -
getOpenRouterApiKey(
) → String - API key para OpenRouter (proveedores OpenAI-compatible: Qwen, DeepSeek, etc.)
-
getOpenRouterBaseUrl(
) → String - Base URL para OpenRouter (o cualquier endpoint OpenAI-compatible)
-
getSecretFromCloud(
String key) → Future< String> - Retrieves a specific secret from Cloud Functions (e.g. googleApiKey for Maps)
-
getServerCliendId(
) → String -
getSpotifyClientId(
) → String -
getSpotifyClientSecret(
) → String - Returns Spotify client secret. Empty in secure mode — use spotifyToken action via Cloud Functions.
-
getStripePublishableKey(
) → String -
getStripeSecretKey(
{bool isLive = true}) → String - Returns Stripe secret key. Empty in secure mode — use stripeProxy() instead.
-
getWebCliendId(
) → String -
getWooAccount(
) → String - Returns WordPress account. Empty in secure mode — use wooMediaProxy() instead.
-
getWooClientKey(
) → String - Returns WooCommerce client key. Empty in secure mode — use wooProxy() instead.
-
getWooClientSecret(
) → String - Returns WooCommerce client secret. Empty in secure mode — use wooProxy() instead.
-
getWooPass(
) → String - Returns WordPress password. Empty in secure mode — use wooMediaProxy() instead.
-
init(
) → Future< void> - Initialize cloud-specific state after AppProperties loads the JSON.
-
loadFromCloud(
) → Future< void> - Loads config from Cloud Functions on web. Stores into AppProperties.appProperties so both classes share the same data.
-
readServiceAccount(
) → Future< void> -
sendNotificationViaCloud(
{required String token, required String title, required String body, Map< String, String> ? data}) → Future<bool> - Calls secureOps Cloud Function to send a push notification server-side. Returns true if sent successfully, false otherwise.
-
stripeProxy(
{required String path, String method = 'POST', String? body, bool isLive = true}) → Future< Map< String, dynamic> ?> -
Calls secureOps Cloud Function to proxy a Stripe API call.
isLivedetermines whether to use the live or test Stripe key. -
wooMediaProxy(
{required String path, String method = 'GET', Map< String, dynamic> ? body}) → Future - Calls secureOps Cloud Function to proxy a WordPress Media API call.
-
wooProxy(
{required String path, String method = 'GET', Map< String, dynamic> ? body}) → Future - Calls secureOps Cloud Function to proxy a WooCommerce API call.