From 55da667a73414e3220c4a69f8733603f1c144324 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Mon, 26 Jan 2026 22:57:15 -0800 Subject: [PATCH] Add isDev environment switch for dev/prod API --- lib/services/api.dart | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/services/api.dart b/lib/services/api.dart index 7688558..3222561 100644 --- a/lib/services/api.dart +++ b/lib/services/api.dart @@ -132,12 +132,17 @@ class Api { // no-op } + // ============================================= + // ENVIRONMENT SWITCH + // ============================================= + // Set to TRUE for testing (dev.payfrit.com) + // Set to FALSE before building for App Store / Play Store + static const bool isDev = true; + static String get baseUrl { - const v = String.fromEnvironment("PAYFRIT_API_BASE_URL"); - if (v.isEmpty) { - return "https://biz.payfrit.com/api"; - } - return v; + return isDev + ? "https://dev.payfrit.com/api" + : "https://biz.payfrit.com/api"; } static Uri _u(String path) {