Component.empty constructor
Component.empty(
- String id
Creates empty Component with empty baseInnerHtml. Useful for subclasses where you then create baseInnerHtml string inside the subclass constructor. The subclass constructor can call super.empty to build empty Component.
In dart, super constructor is always called first, before the subclass constructor. Therefore, creating component with non empty constructor can't be done because it needs you to supply baseInnerHtml string beforehand.
Implementation
Component.empty(String id) {
if (id == '') throw ArgumentError('Must not be empty', 'id');
_id = id;
}