简体   繁体   中英

Flutter Release APK misbehaving

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM