TahaMalas / flutter_image_viewer

MIT License
10 stars 4 forks source link

Failed to handle method call - Theme.AppCompat #13

Open kcibdev opened 1 year ago

kcibdev commented 1 year ago

Whenever i try to use the package image_viewer: ^1.5.0. I get the error

E/MethodChannel#image_viewer(31309): Failed to handle method call
E/MethodChannel#image_viewer(31309): java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
E/MethodChannel#image_viewer(31309):    at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:555)
E/MethodChannel#image_viewer(31309):    at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
E/MethodChannel#image_viewer(31309):    at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466)
E/MethodChannel#image_viewer(31309):    at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:94)
E/MethodChannel#image_viewer(31309):    at androidx.appcompat.app.AlertController.installContent(AlertController.java:232)
E/MethodChannel#image_viewer(31309):    at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279)
E/MethodChannel#image_viewer(31309):    at android.app.Dialog.dispatchOnCreate(Dialog.java:407)
E/MethodChannel#image_viewer(31309):    at android.app.Dialog.show(Dialog.java:302)

And i use flutter: 3.7. Please how can i resolve this

lripardo commented 1 year ago

See your styles.xml. Your theme must inherit from Theme.AppCompat and its derivatives which is different from the default styles.xml generated by Flutter.