feat: add multi-environment support (development, staging, production)

- Replace dotenv with compile-time dart-define-from-file config per flavor
  - Add Android product flavors with applicationIdSuffix and per-flavor AndroidManifest
  - Add iOS build configurations, schemes, per-flavor plists and entitlements
  - Configure ProGuard rules for R8 compatibility with Entrust/Antelop SDK
  - Restructure assets into shared/ and per-flavor directories
  - Generate per-flavor launcher icons for Android and iOS
  - Refactor app initialization into initApp() with per-flavor entry points
  - Update asset paths across auth, home, profile, splash modules and sf_shared
This commit is contained in:
2026-03-01 00:12:47 +01:00
parent 213279de18
commit ef0abc2f85
226 changed files with 1751 additions and 252 deletions

View File

@@ -1,2 +0,0 @@
API_BASE_URL=https://api-neki-b2b.neki.es/gateway/api/
API_ORIGIN =https://neki-b2b.neki.es

View File

@@ -39,6 +39,31 @@ android {
buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
debug {
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
isMinifyEnabled = false
isShrinkResources = false
}
}
flavorDimensions += "app"
productFlavors {
create("development") {
dimension = "app"
applicationIdSuffix = ".dev"
resValue("string", "app_name", "SF Dev")
}
create("staging") {
dimension = "app"
applicationIdSuffix = ".staging"
resValue("string", "app_name", "SF Staging")
}
create("production") {
dimension = "app"
resValue("string", "app_name", "SaveFamily")
}
}
}

View File

@@ -0,0 +1,23 @@
## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**
## Antelop/Entrust SDK - suppress warnings for optional dependencies
-dontwarn com.google.android.gms.location.FusedLocationProviderClient
-dontwarn com.google.android.gms.location.LocationServices
-dontwarn com.huawei.hmf.tasks.Task
-dontwarn com.huawei.hmf.tasks.Tasks
-dontwarn com.huawei.hms.aaid.HmsInstanceId
-dontwarn com.huawei.hms.api.HuaweiApiAvailability
-dontwarn com.huawei.hms.api.HuaweiServicesNotAvailableException
-dontwarn com.huawei.hms.api.HuaweiServicesRepairableException
-dontwarn com.huawei.hms.common.ApiException
-dontwarn com.huawei.hms.location.FusedLocationProviderClient
-dontwarn com.huawei.hms.location.LocationServices
-dontwarn com.huawei.hms.push.RemoteMessage
-dontwarn com.huawei.hms.security.SecComponentInstallWizard

View File

@@ -0,0 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<meta-data
android:name="fr.antelop.application_id"
android:value="4713640103500149457" />
<meta-data
android:name="fr.antelop.issuer_id"
android:value="treezor" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground>
<inset
android:drawable="@drawable/ic_launcher_foreground"
android:inset="16%" />
</foreground>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -6,17 +6,10 @@
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<application
android:label="SaveFamily"
android:label="@string/app_name"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<meta-data
android:name="fr.antelop.application_id"
android:value="4713640103500149457" />
<meta-data
android:name="fr.antelop.issuer_id"
android:value="treezor" />
<activity
android:name=".MainActivity"
android:exported="true"

View File

@@ -0,0 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<meta-data
android:name="fr.antelop.application_id"
android:value="4713640103500149457" />
<meta-data
android:name="fr.antelop.issuer_id"
android:value="treezor" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1023 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground>
<inset
android:drawable="@drawable/ic_launcher_foreground"
android:inset="16%" />
</foreground>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -0,0 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<meta-data
android:name="fr.antelop.application_id"
android:value="4713640103500149457" />
<meta-data
android:name="fr.antelop.issuer_id"
android:value="treezor" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground>
<inset
android:drawable="@drawable/ic_launcher_foreground"
android:inset="16%" />
</foreground>
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 563 B

After

Width:  |  Height:  |  Size: 563 B

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 469 KiB

After

Width:  |  Height:  |  Size: 469 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 945 B

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -0,0 +1,5 @@
{
"env": "development",
"apiBaseUrl": "https://api-neki-b2b.neki.es/gateway/api/",
"apiOrigin": "https://neki-b2b.neki.es"
}

View File

@@ -0,0 +1,5 @@
{
"env": "production",
"apiBaseUrl": "https://api-neki-b2b.neki.es/gateway/api/",
"apiOrigin": "https://neki-b2b.neki.es"
}

View File

@@ -0,0 +1,5 @@
{
"env": "staging",
"apiBaseUrl": "https://api-neki-b2b.neki.es/gateway/api/",
"apiOrigin": "https://neki-b2b.neki.es"
}

View File

@@ -0,0 +1,11 @@
flutter_launcher_icons:
android: true
ios: true
image_path: "assets/development/ic_logo.png"
image_path_android: "assets/development/ic_logo.png"
image_path_ios: "assets/development/ic_logo.png"
adaptive_icon_background: "assets/development/ic_logo_background.png"
adaptive_icon_foreground: "assets/development/ic_logo.png"
min_sdk_android: 21
background_color_ios: "#FFFFFF"
remove_alpha_ios: true

View File

@@ -0,0 +1,11 @@
flutter_launcher_icons:
android: true
ios: true
image_path: "assets/production/ic_logo.png"
image_path_android: "assets/production/ic_logo.png"
image_path_ios: "assets/production/ic_logo.png"
adaptive_icon_background: "assets/production/ic_logo_background.png"
adaptive_icon_foreground: "assets/production/ic_logo.png"
min_sdk_android: 21
background_color_ios: "#FFFFFF"
remove_alpha_ios: true

View File

@@ -0,0 +1,11 @@
flutter_launcher_icons:
android: true
ios: true
image_path: "assets/staging/ic_logo.png"
image_path_android: "assets/staging/ic_logo.png"
image_path_ios: "assets/staging/ic_logo.png"
adaptive_icon_background: "assets/staging/ic_logo_background.png"
adaptive_icon_foreground: "assets/staging/ic_logo.png"
min_sdk_android: 21
background_color_ios: "#FFFFFF"
remove_alpha_ios: true

View File

@@ -1,10 +0,0 @@
flutter_launcher_icons:
android: true
ios: true
image_path: "assets/logos/logo_splash.png"
image_path_android: "assets/images/logos/logo_splash.png"
image_path_ios: "assets/images/logos/logo_splash.png"
adaptive_icon_background: "assets/images/logos/ic_logo_background.png"
adaptive_icon_foreground: "assets/images/logos/logo_splash.png"
min_sdk_android: 21
background_color_ios: "#FFFFFF"

View File

@@ -0,0 +1,15 @@
flutter_native_splash:
fullscreen: true
color: "#F7F7F7"
image: assets/shared/images/logo_splash.png
android_gravity: center
ios_content_mode: scaleAspectFit
android: true
ios: true
web: false
android_12:
color: "#F7F7F7"
icon_background_color: "#F7F7F7"
image: assets/shared/images/logo_splash.png

View File

@@ -1,2 +1,5 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-development.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-staging.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug-production.xcconfig"
#include "Generated.xcconfig"

View File

@@ -1,2 +1,8 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-development.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-staging.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-production.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-development.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-staging.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile-production.xcconfig"
#include "Generated.xcconfig"

View File

@@ -5,9 +5,15 @@ platform :ios, '13.4'
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
'Debug-development' => :debug,
'Debug-staging' => :debug,
'Debug-production' => :debug,
'Profile-development' => :release,
'Profile-staging' => :release,
'Profile-production' => :release,
'Release-development' => :release,
'Release-staging' => :release,
'Release-production' => :release,
}
def flutter_root

Some files were not shown because too many files have changed in this diff Show More