Hi I'm new to flutter and I'm currently trying to work with Realtime Database from firebase. I manage to get all my data from RTDB and I also made function to edit the data in RTDB.
The problem is I cannot make my Widget to rebuild when I already done updating the RTDB data.
Here's how the process of the Data fetching and updating goes:
- First, We will have variable A on screen A to fetch the RTDB data in the initState
- Second, the fetched data will be used to create Widget of Text in Screen A
- Third, there will be a button on screen A to push the screen to Screen B (Editing Page)
- Fourth, After the user done editing it will push the user into Splash Screen and it will be Pop back to screen A
- Fifth (Here's the problem), the Widget still build the old data, not the new data that has been edited.
I thought after step 4, Screen A will do the fetching again in initState.. Am I wrong ? How can I do the rebuild of widget ? Thanks before