Updating Data

This page describes how to update the document data of the Firestore collection.

Before You Begin:

  1. Finish the steps in the Firebase Setup for your project.

  2. Set up a Collection.

Updating a document

Updating allows you to make changes to a single document. For example, you could display the Todo details on a new page and allow users to update any Todo information. Just like the following visual:

Showing and updating document data consists of the following steps:

  1. Build a page (skip this if you already have a page designed)

1. Build a page

First, let's design a page that allows you to update the Todo details:

  1. Add two TextField widgets to show Todo title and description.

  2. Add a Container widget (to open DatePicker) and a Text widget (to show selected date).

  3. And a Button to save changes.

2. Showing existing data in UI elements

Before you allow users to update any data, you must display it on the screen.

Passing Data: Make sure to define the parameter on this page of the Type Document and pass its value from the previous page (e.g., the TodoDetails page). You can follow the instructions for passing the data from one page to another here.

To show data in the TextField widget, use the Initial Value property and set its value from the page parameter data.

3. Adding action to update record

Check how to add an action to update a record.


Last Updated Date: September 28, 2023

Last updated