Custom collection in the dart?
I'm trying to figure out how to create a custom collection of custom objects in Dart and have a List as an abstract class, I don't see any other way than to "have" a list in my custom collection:
class MenuItemCollection { List<MenuItem> _items; MenuItemCollection() { _items = new List<MenuItem>(); } List<MenuItem> get items => _items; }
Is there a better way to do this?
+3
source to share