How best to implement the following: I need to show a regular window on a smartphone, and show the same window on a tablet as a popup dialog. There are several such windows in different places. Which would be more correct:
- use
Navigator.pushNamed()
, catch routes inonGenerateRoute
method, make a custom router class and determine which option to show from it, or - leave the logic in the parent window, that is, detect the type of device in it and do either
Navigator.pushNamed()
orshowDialog
, but then the meaning of named routes is lost.
I think you have to try to implement show dialogue inside the stateless widget class so you can get result which you want.