toJsonMap method
Returns a enum instance as a JSON Map.
Implementation
@override
Map<String, Object>? toJsonMap({O? obj, JsonEncoder? jsonEncoder}) {
obj ??= object;
if (obj == null) return null;
var name = getName(obj)!;
var index = getIndex(obj)!;
return {'name': name, 'index': index};
}