Inject Android Image Loader
You could inject an Android image loader that can be one of the predefined Glide or Picasso or your custom implementation of the
com.firework.imageloading.ImageLoader
interface using your own solution.Step 1: add the library dependency inside the
dependencies
block in the firework.gradle.
dependencies {
implementation "com.firework.external.imageloading:glide:+"
...
}
configurations.all {
resolutionStrategy.eachDependency { details ->
...
if (details.requested.group == 'com.firework.external.imageloading' && details.requested.name == 'glide') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
}
}
Step 2: add the following codes to the
MainApplication
classimport com.firework.imageloading.glide.GlideImageLoaderFactory
import com.fireworksdk.bridge.flutter.FWFlutterSDK
class MainApplication: FlutterApplication() {
override fun onCreate() {
super.onCreate()
FWFlutterSDK.setImageLoader(GlideImageLoaderFactory.createInstance(this))
}
}
Step 1: add the library dependency inside the
dependencies
block in the firework.gradle.
dependencies {
implementation "com.firework.external.imageloading:picasso:+"
...
}
configurations.all {
resolutionStrategy.eachDependency { details ->
...
if (details.requested.group == 'com.firework.external.imageloading' && details.requested.name == 'picasso') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
}
}
Step 2: add the following codes to the
MainApplication
classimport com.firework.imageloading.picasso.PicassoImageLoaderFactory
import com.fireworksdk.bridge.flutter.FWFlutterSDK
class MainApplication: FlutterApplication() {
override fun onCreate() {
super.onCreate()
FWFlutterSDK.setImageLoader(PicassoImageLoaderFactory.createInstance(this))
}
}
Last modified 3mo ago