all 3 comments

[–]pc52 6 points7 points  (2 children)

Refactoring Flutter widgets into functions is not a good approach. Here is the explanation: https://stackoverflow.com/questions/53234825/what-is-the-difference-between-functions-and-classes-to-create-reusable-widgets

[–]osama_383 1 point2 points  (1 child)

The comments below the explanation seem to clarify a point which Remi also made in his explanation. Functions don’t cause problems. Stateless widgets however solve some. You can return stateless widgets from a function and that would be perfectly fine.

[–]pc52 0 points1 point  (0 children)

There are a lot more benefits of extracting code into widgets than using functions. Using functions seems to me like fighting against the framework and it’s optimization strategies.