Suppose your app, which built by flutter 1.2, has ItemListScreen and ItemDetailScreen, and this app uses named route to manage routing of app. Users can click one of item in ItemListScreen and then ItemDetailScreen will show detail information of the clicked item. You can find following example to decouple between screens by no need importing ItemDetailScreen class to ItemListScreen file. Solution: Use ModalRoute.of(context).settings.arguments in your routes.dart file to pass arguments
read more