Home > front end >  Is there any way to pass data between two screen without using context in flutter?
Is there any way to pass data between two screen without using context in flutter?

Time:03-02

I want to pass data between two pages. but I don't want to use context or Shared Prefarance, or Constractor how is it possible?

CodePudding user response:

Create a Global variable and store your value

Even that also don't want, than

use sqflite: ^2.0.2 to store your data

CodePudding user response:

Generally to pass data between Pages we use Navigation.pushNamed(context, arguments: "your data here")

This is the best way if communications are being made between 2 pages

But if you don't want to use that. You can also use State management solution. Some of the state management solutions are listed below

1)Provider 2)Riverpod 3)InheritedWidget 4)Redux 5)MobX 6)GetIt 7)GetX

GetX is most prefered if you want to get rid of context

CodePudding user response:

Using GetX

Using arguments: https://chornthorn.github.io/getx-docs/route-management/index

Get Storage: https://chornthorn.github.io/getx-docs/index

  • Related