Add isDev environment switch for dev/prod API
This commit is contained in:
parent
3e68a3282b
commit
55da667a73
1 changed files with 10 additions and 5 deletions
|
|
@ -132,12 +132,17 @@ class Api {
|
||||||
// no-op
|
// 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 {
|
static String get baseUrl {
|
||||||
const v = String.fromEnvironment("PAYFRIT_API_BASE_URL");
|
return isDev
|
||||||
if (v.isEmpty) {
|
? "https://dev.payfrit.com/api"
|
||||||
return "https://biz.payfrit.com/api";
|
: "https://biz.payfrit.com/api";
|
||||||
}
|
|
||||||
return v;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Uri _u(String path) {
|
static Uri _u(String path) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue