How can I navigate between 2 classes, one of them requires passing data? in flutter
you can use constructor but in this case, whenever you use this class, you have to provide value, also you can make class value nullable and check it on build time. Another way is passing data by Route. for more navigate-with-arguments Here are is example: Passing data using ModalRoute Navigator.of(context).push( MaterialPageRoute( builder: (context) => WidgetA(), … Read more