feat: implement production flavor with environment configuration and build support
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
# Demo Environment Configuration
|
||||
API_BASE_URL=https://beta.re-quest.com/api/v1
|
||||
STORAGE_BASE_URL=https://sin1.contabostorage.com/request
|
||||
|
||||
1
.env.dev
1
.env.dev
@@ -1,3 +1,2 @@
|
||||
# Dev Environment Configuration
|
||||
API_BASE_URL=https://dev.re-quest.com/api/v1
|
||||
STORAGE_BASE_URL=https://sin1.contabostorage.com/request
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
# Local Environment Configuration
|
||||
API_BASE_URL=http://localhost:3001/api/v1
|
||||
STORAGE_BASE_URL=https://sin1.contabostorage.com/request
|
||||
|
||||
2
.env.prod
Normal file
2
.env.prod
Normal file
@@ -0,0 +1,2 @@
|
||||
# Prod Environment Configuration
|
||||
API_BASE_URL=https://re-quest.com/api/v1
|
||||
@@ -51,6 +51,12 @@ android {
|
||||
keyAlias = keyProperties.getProperty("demoKeyAlias", "")
|
||||
keyPassword = keyProperties.getProperty("demoKeyPassword", "")
|
||||
}
|
||||
create("prodRelease") {
|
||||
storeFile = file(keyProperties.getProperty("prodStoreFile", ""))
|
||||
storePassword = keyProperties.getProperty("prodStorePassword", "")
|
||||
keyAlias = keyProperties.getProperty("prodKeyAlias", "")
|
||||
keyPassword = keyProperties.getProperty("prodKeyPassword", "")
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions += "flavor-type"
|
||||
@@ -73,6 +79,12 @@ android {
|
||||
resValue("string", "app_name", "RE-Quest Dev")
|
||||
signingConfig = signingConfigs.getByName("devRelease")
|
||||
}
|
||||
create("prod") {
|
||||
dimension = "flavor-type"
|
||||
// No applicationIdSuffix — prod uses the base applicationId
|
||||
resValue("string", "app_name", "RE-Quest")
|
||||
signingConfig = signingConfigs.getByName("prodRelease")
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
3
ios/Flutter/flavors/prod.xcconfig
Normal file
3
ios/Flutter/flavors/prod.xcconfig
Normal file
@@ -0,0 +1,3 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.requestn.realEstateMobile
|
||||
PRODUCT_NAME = RE-Quest
|
||||
DISPLAY_NAME = RE-Quest
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
enum Flavor { local, demo, dev }
|
||||
enum Flavor { local, demo, dev, prod }
|
||||
|
||||
class AppConfig {
|
||||
static late Flavor flavor;
|
||||
@@ -13,5 +13,4 @@ class AppConfig {
|
||||
}
|
||||
|
||||
static String get apiBaseUrl => dotenv.env['API_BASE_URL'] ?? '';
|
||||
static String get storageBaseUrl => dotenv.env['STORAGE_BASE_URL'] ?? '';
|
||||
}
|
||||
|
||||
4
lib/main_prod.dart
Normal file
4
lib/main_prod.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
import 'package:real_estate_mobile/config/app_config.dart';
|
||||
import 'package:real_estate_mobile/main.dart';
|
||||
|
||||
void main() => mainCommon(Flavor.prod);
|
||||
@@ -100,6 +100,7 @@ flutter:
|
||||
- .env.local
|
||||
- .env.demo
|
||||
- .env.dev
|
||||
- .env.prod
|
||||
|
||||
fonts:
|
||||
- family: Fractul
|
||||
|
||||
Reference in New Issue
Block a user