@@ -64,18 +64,20 @@ class ViewUtil {
6464 static WidgetModel buildModel (
6565 dynamic item, Map <String , dynamic >? customWidgetMap) {
6666 String ? widgetType;
67- YamlMap ? payload;
67+ Map ? payload;
6868 SourceSpan def =
6969 SourceSpanBase (SourceLocationBase (0 ), SourceLocationBase (0 ), '' );
7070 // name only e.g Spacer
7171 if (item is String ) {
7272 widgetType = item;
73- } else if (item is YamlMap ) {
73+ } else if (item is Map ) {
7474 widgetType = item.keys.first.toString ();
75- if (item[widgetType] is YamlMap ) {
75+ if (item[widgetType] is Map ) {
7676 payload = item[widgetType];
7777 }
78- def = getDefinition (item);
78+ if (item is YamlMap ) {
79+ def = getDefinition (item);
80+ }
7981 if (item.keys.length > 1 ) {
8082 //multiple widgets found, it is probably because user used wrong indentation
8183 //TODO: we'll send a warning back
@@ -151,7 +153,7 @@ class ViewUtil {
151153 }
152154
153155 static WidgetModel ? buildCustomModel (
154- YamlMap ? callerPayload,
156+ Map ? callerPayload,
155157 dynamic viewDefinition,
156158 String widgetType,
157159 Map <String , dynamic > customWidgetMap) {
@@ -166,13 +168,13 @@ class ViewUtil {
166168 }
167169
168170 Map <String , dynamic > inputPayload = {};
169- if (callerPayload? ['inputs' ] is YamlMap ) {
171+ if (callerPayload? ['inputs' ] is Map ) {
170172 callerPayload! ['inputs' ].forEach ((key, value) {
171173 inputPayload[key] = value;
172174 });
173175 }
174176 Map <String , EnsembleAction ?> eventPayload = {};
175- if (callerPayload? ['events' ] is YamlMap ) {
177+ if (callerPayload? ['events' ] is Map ) {
176178 callerPayload! ['events' ].forEach ((key, value) {
177179 eventPayload[key] = EnsembleAction .fromYaml (value);
178180 });
@@ -191,7 +193,7 @@ class ViewUtil {
191193 inputParams.add (input.toString ());
192194 }
193195 }
194- if (entry.key == 'events' && entry.value is YamlMap ) {
196+ if (entry.key == 'events' && entry.value is Map ) {
195197 for (var event in entry.value.entries) {
196198 eventParams[event.key] =
197199 EnsembleEvent .fromYaml (event.key, event.value);
@@ -218,8 +220,8 @@ class ViewUtil {
218220
219221 // custom widgets can have styles too
220222 Map <String , dynamic > styles = {};
221- if (callerPayload? ["styles" ] is YamlMap ) {
222- (callerPayload! ["styles" ] as YamlMap ).forEach ((styleKey, styleValue) {
223+ if (callerPayload? ["styles" ] is Map ) {
224+ (callerPayload! ["styles" ] as Map ).forEach ((styleKey, styleValue) {
223225 styles[styleKey] = EnsembleThemeManager .yamlToDart (styleValue);
224226 });
225227 }
0 commit comments