Flutter Send data to a new screen:
Most of the times, we not only want to navigate to a new screen, but also we want to pass some data to the new screen as well. For example, we often want to pass information about the item we tapped on.
In Flutter Screens are Just Widget. In this example, we will create a List of Todos. When we tapped on the todo, we will navigate to a new screen ( here in flutter new screen is a Widget) that displays information about the todo.
Using Send data to a new screen functionality in Flutter:
- Define a Todo class
- Display a List of Todos
- Create a Detail Screen that can display information about a todo
- Navigate and pass data to the Detail Screen
First we have to define a Todo class:
Here, we will need a simple way to represent Todos. In this example, we will create a class that contains two pieces of data: i.e one is the title and other one is description.