$getModelHandler<U> method
Implementation
@nonVirtual
@internal
$ModelHandler<U> $getModelHandler<U>(String key, bool useDummyModelIfNotProvidedByHostWidget) {
$ModelHandler<U>? modelHandler = this.$tryGetModelHandler<U>(key);
if (modelHandler == null) {
// the host component didn't provide a model. create a local one
if (useDummyModelIfNotProvidedByHostWidget) {
modelHandler = this._getOrMakeBackupModelHandler<U>(key);
}
else {
throw "Mandatory model [${key}] not provided to Widget [${this}]";
}
}
return modelHandler;
}