thanks for this great package! this is a snippet of my code
CachedNetworkImage(
fit: BoxFit.cover,
height: 200,
width: MediaQuery.of(context).size.width,
color: Colors.white,
imageUrl:
"https://www.example.com/api/services_img/${data[index]['photo']}",
placeholder: (context, url) =>
CircularProgressIndicator(),
errorWidget: (context, url, error) =>
new Icon(Icons.error),
),
Had the same problem. Reinstalled the app and now it works. 🤷♂
Maybe this is a problem with flutter_cache_manager which use sqflight
V/DartMessenger(20514): Received message from Dart over channel 'com.tekartik.sqflite'
V/DartMessenger(20514): Deferring to registered handler to process message.
E/AndroidRuntime(20514): FATAL EXCEPTION: Sqflite
E/AndroidRuntime(20514): Process: com.example.fanli.host, PID: 20514
E/AndroidRuntime(20514): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Sqflite
E/AndroidRuntime(20514): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:794)
E/AndroidRuntime(20514): at io.flutter.embedding.engine.FlutterJNI.invokePlatformMessageResponseCallback(FlutterJNI.java:727)
E/AndroidRuntime(20514): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:140)
E/AndroidRuntime(20514): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:225)
E/AndroidRuntime(20514): at com.tekartik.sqflite.SqflitePlugin$6.run(SqflitePlugin.java:778)
E/AndroidRuntime(20514): at android.os.Handler.handleCallback(Handler.java:743)
E/AndroidRuntime(20514): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(20514): at android.os.Looper.loop(Looper.java:150)
E/AndroidRuntime(20514): at android.os.HandlerThread.run(HandlerThread.java:61)
@yossefEl this is a problem with sqflite used in 'flutter_cache_manager', and has resolved in v1.1.6+1. You can redo 'Packages get' to resolved this problem
@loumzy @itsJoKr Thanks a ot i just hot restarted the app and it works perfectly.
Most helpful comment
Had the same problem. Reinstalled the app and now it works. 🤷♂