As you all know dart is client optimized programming language for multiple platforms and that special term client optimized always indicates that Dart will always come with more suitable and optimized techniques to make developers work with ease. the same thing happened during the announcement of Dart 2.6 when extensions were introduced however that was for a preview but it was finally released in 2.7. Basically extensions feature is the way to add functionality to existing libraries.

If we understand extension methods by a scenario then it would be like

When you’re using someone else’s API or when you implement a library that’s widely used, it’s often impractical or impossible to change the API. But you might still want to add some functionality.

then the most probable solution for that is by writing wrapper classes with static methods and members and it could cause an increase of the number of objects and then extensions feature come in to play.

#extension-functions #dart #extension-method #flutter #cross-platform

Dart Extensions Methods
1.50 GEEK