jonataslaw / get_storage

A fast, extra light and synchronous key-value storage to Get framework
MIT License
369 stars 83 forks source link

Flutter Get.Storage() not changing data while using Get.back() #116

Open saminBee opened 2 years ago

saminBee commented 2 years ago

Get.back() does not change the data. It stores data while I write in GetStorage but only Get.to()/ Get.named() these changes the data of Get.Storage(). While try to Get.back() it is not changing the data. Is there any solution for this?

allasca commented 1 year ago

after get.back you need to re-read it

huzeyfetas commented 1 year ago

use await keyword on your navigate code statement. and listen to get.back with payload. and decide to rebuild widget tree or not. bool? isNeedReBuild = await Get.to(()=>XScreen()); if(isNeedRebuild){ // fetch your data from storage and setstate the widget tree }

Get.Back(result:true);