toMap method
Implementation
@override
Map<String, dynamic> toMap() {
final lastStep = _currentStep();
if (_code == null && lastStep != null && lastStep._code != null) {
setResult(lastStep._code!, lastStep._msg, lastStep._requestId);
}
final props = super.toMap();
final itemList = steps.values.toList();
if (itemList.isNotEmpty) {
props[XKitEventConstants.keySteps] =
itemList.asMap().entries.map((entry) {
final index = entry.key;
final intervalStep = entry.value;
final stepMap = intervalStep.toMap();
stepMap[XKitEventConstants.keyIndex] = index;
return stepMap;
}).toList();
}
return props;
}