isComponent property
bool
get
isComponent
Whether it is a component definition: a widget declaration with a
type, and exactly one root.
Implementation
bool get isComponent => widget != null && roots.length == 1;