design-patterns-in-dart
design-patterns-in-dart copied to clipboard
Improve decorator pattern example
In the decorator pattern example, the two classes are different. The StarbucksDecorator is not decorating an existing coffee object but creating a new coffee object every time. This class should take a coffee object in its constructor and work on it. Let me know what you think about it. I'd love to contribute to this.