I have realized that it is possible to create widgets using plain functions instead of subclassing StatelessWidget. An example would be this:
Widget functio
When you are calling the Flutter widget make sure you use the const keyword. For example const MyListWidget();
const MyListWidget();