Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,20 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 29
if (project.android.hasProperty('namespace')) {
namespace 'com.byneapp.flutter_config'
}

compileSdkVersion 30

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
4 changes: 4 additions & 0 deletions android/dotenv.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def loadDotEnv(flavor = getCurrentFlavor()) {
loadDotEnv()

android {
if (project.android.hasProperty('namespace')) {
namespace 'com.byneapp.flutter_config'
}

defaultConfig {
project.env.each { k, v ->
def escaped = v.replaceAll("%", "\\\\u0025")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry.Registrar
import java.lang.IllegalArgumentException
import java.lang.reflect.Field

Expand All @@ -31,14 +30,6 @@ class FlutterConfigPlugin(private val context: Context? = null): FlutterPlugin,
applicationContext = null
}

companion object {
@JvmStatic
fun registerWith(registrar: Registrar) {
val channel = MethodChannel(registrar.messenger(), "flutter_config")
channel.setMethodCallHandler(FlutterConfigPlugin(registrar.activity()))
}
}

override fun onMethodCall(call: MethodCall, result: Result) {
if (call.method == "loadEnvVariables") {
val variables = loadEnvVariables()
Expand Down