findWidgetModel static method

WidgetModel? findWidgetModel(
  1. String? id,
  2. Scope? scope
)

Implementation

static WidgetModel? findWidgetModel(String? id, Scope? scope) {
  if (id == null) return null;

  // named scope reference?
  if (id.contains(".")) {
    var parts = id.split(".");
    var myScope = System.currentApp?.scopeManager.of(parts.first.trim());
    if (myScope != null) {
      scope = myScope;
      parts.removeAt(0);
    }
    id = parts.first;
  }

  // get the model
  return scope?._findWidgetModel(id);
}