CopyWith ease with Flutter

If you use Flutter Blocs you must be familiar with Equatable. Equatable is an extension that prevents you to override the “==” operator and hashCode functions, thus reducing boilerplate code.

Classes extending Equatable are by nature immutable and enforces you to define all instance variables as final. This is great until you have the need to modify a specific variable from an existing object of such classes.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store