mappedData property

Map<String, String> get mappedData

Maps Dart enum property names to their corresponding database string values.

This creates a mapping where keys are valid Dart identifiers and values are the original database enum strings. This is used for generating the .name getter that returns the database string value.

Example:

{'active': 'active', 'pending': 'pending'}

Implementation

Map<String, String> get mappedData {
  final result = <String, String>{};
  for (var element in values) {
    final data = _formatEnumProperty(element);
    result[data] = element;
  }

  return result;
}