1

I have many states in my app, but many of them contain 4 same States :

  • Idle
  • Loading
  • Success
  • Error

I'm using Freezed library to create my states. It forces me to create a lot of boilerplate code, because I have to add 4 additional constructors in each bloc state.

I want know, how I can avoid code duplication? May I extend one sealed class from another to inherit 4 constructors described above?

Sergey Shustikov
  • 15,377
  • 12
  • 67
  • 119
  • Extending any object is not supported at the moment as told on [git issue](https://github.com/rrousselGit/freezed/issues/464#issuecomment-861331010) and this might be duplicate of [this](https://stackoverflow.com/q/63285384/10157127) – Md. Yeasin Sheikh Dec 22 '21 at 09:09

0 Answers0