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
|
||||
}
|
||||
|
||||
// =============================================
|
||||
// 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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue