flutterwidgetobservablerefreshflutter-getx

flutter observable widget and refreshing widget state


Can someone help me to refresh card slider widget when added new card. I tried to use obx widget but something went wrong and got error. then i tried to refresh a text widget when added a new card but i couldn't refresh the text.

I want to make changes on this screen with Obx() widget.

I put some .obs variables but app not watching this variables. here i am sharing repository branch to yours to see project.


Solution

  • How to fix it: Already using stateful widget so if we want to refresh widget after get back to previous widget we put then function after MaterialPageRoute function.

    set variables observable like Rxbool, RxInt or bool iswatching = true.obs. And then use Obx as Parent widget but never forget to use variable which is watching.