We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dba5743 commit a0adc16Copy full SHA for a0adc16
lib/src/api/nodes/icon_node.dart
@@ -93,7 +93,16 @@ class IconNode extends SceneNode
93
];
94
95
/// Creates an [IconNode] from a JSON data.
96
- factory IconNode.fromJson(Map json) => _$IconNodeFromJson(json);
+ factory IconNode.fromJson(Map json) {
97
+ // backwards compatibility: before properties were added to IconNode.
98
+ if (json.containsKey('icon') && !json.containsKey('properties')) {
99
+ json['properties'] = <String, dynamic>{
100
+ 'icon': json['icon'],
101
+ };
102
+ json.remove('icon');
103
+ }
104
+ return _$IconNodeFromJson(json);
105
106
107
@override
108
Map toJson() => _$IconNodeToJson(this);
0 commit comments