'I want to pass some variable in my method, how do I pass a class name?

ListTile listTileDrawer({required String info, required Icon iconic, required ?? route() })

Hello I have this code I am working on and I have had it working to a point, but I want to have each tile go to their own page.

I cannot seem to find how to pass the initial part of the class?

i.e.  builder: (BuildContext context) =\> messages()

For example i want to have the following.

listTileDrawer(
iconic: const Icon(Icons.message),
info: 'Messages',
route:  'Messages()'

can I call the Messages() route from here? If so I have tried String but to no avail. What am I doing wrong?

Can I call the Messages() route from here? If so I have tried String but to no avail. What am I doing wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source