Flutter Release APK misbehaving

38 views Asked by At

i am developing an ecommerce app which works very fine in debug mode,but surprisingly after generating a signed release apk it does not work well. SCENARIO. when i add items to cart for the first time after starting an app ,items are added to cart and cart length is updated on top of cart icon.but after opening cart page(view items in the cart),this starts to misbehave ,items are added into cart but cart length no longer updates unless i do refresh the page,also all buttons inside cart page (delete items from the cart button , add product quantity and reduce product quantity buttons.) does not work until i get out of cart page and come back again. also, after opening cart page ,other provider functions like filtering subcategories inside a category also does not work until some refresh . However these does not happen in debug mode ,just only in release mode. Iam using provider for State management. what's a possible cause for this problem.i would appreciate any help

1

There are 1 answers

2
Delta Adams On

You are using a "global" provider function which is not called when the state changes. In your case, the issue is that you are calling the provider function on a non-existing instance of the provider class. This is the reason why the code works in debug mode.