Home > Net >  In flutter can we fetch data from firestore where the place data insert?
In flutter can we fetch data from firestore where the place data insert?

Time:09-07

In flutter can we fetch data from Firestore where the place data insert ? As an example when we select the radio button can we save the data to the Firestore and fetch the data to the radio button when close and on same page

CodePudding user response:

... when we select the radio button can we save the data to the Firestore ...

Yes. The callback for selecting a radio option can save the selected option to Firestore.

... fetch the data to the radio button when close and on same page

Yes. You can use StreamBuilder for that page. The stream will be the Firestore document. The builder will return the radio buttons with the value to be displayed. It can also have a conditional CircularProgressIndicator for when the data is being fetched.


To ensure your app works smoothly, you might have to keep the user waiting while you are saving data to Firestore. So you might have a "Save" button on that page that will do the actual saving (instead of using a callback). Or you might show a loader and block the UI when the callback is saving the radio button to data to Firestore (in the onTap of the radio button).

  • Related