getDefinition method

  1. @override
Future<ScreenDefinition> getDefinition({
  1. String? screenId,
  2. String? screenName,
})
override

Implementation

@override
Future<ScreenDefinition> getDefinition(
    {String? screenId, String? screenName}) async {
  String? content;

  if (screenId != null) {
    content = hostCache[_getCacheKey(screenId)];
  } else if (screenName != null) {
    final screenId = appModel.screenNameMappings[screenName];
    if (screenId != null) {
      content = hostCache[_getCacheKey(screenId)];
    }
  } else if (appModel.homeMapping != null) {
    content = hostCache[_getCacheKey(appModel.homeMapping!)];
  }

  return content != null
      ? ScreenDefinition(loadYaml(content))
      : ScreenDefinition(YamlMap());
}