Transferring Data
Learn to send and receive data across pages.
Overview
We know how to navigate to a page and back. But what about data? Sometimes, we need to pass data to the next page. For example, a user’s login details need to be passed to the profile page after successful login. So, in this lesson, let’s learn how to transfer data during navigation.
There are essentially two ways to transfer data from one page to another:
Through constructor
Through arguments
Let’s discuss both of them one by one.
Through the constructor
The first way to transfer data from one page to another is to pass it through the widget’s constructor.
Get hands-on with 1400+ tech skills courses.