I'm going to implement smart text selection in my flutter application.
The android project is using kotlin. so I should write a custom service that extends TextClassifierService, but I can Import it like it doesn't exists!
this is my app/build.gradle:
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
dependencies {
implementation "androidx.textclassifier:textclassifier:1.0.0-alpha04"
}
android {
namespace = "com.example.app"
compileSdk = 35
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId = "com.example.app"
minSdk = 29
targetSdk = 35
versionCode = flutter.versionCode
versionName = flutter.versionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}
flutter {
source = "../.."
}
I've changed minSdk to 29 to see if it works but it didn't, is it even necessary to use api 29 for minSdk?
also this is my repositories inside build.gradle:
allprojects {
repositories {
google()
mavenCentral()
}
}
I also tried to import android.service.textclassifier.TextClassifierService
in java but it didn't work too.
what should I do?