toMap method

Map<String, dynamic> toMap({
  1. EnumMethod? enumMethod,
})

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "frame": frame?.toMap(enumMethod: enumMethod),
    "origin": origin.toString(),
    "resources": resources
        .map(
          (e) => switch (enumMethod ?? EnumMethod.nativeValue) {
            EnumMethod.nativeValue => e.toNativeValue(),
            EnumMethod.value => e.toValue(),
            EnumMethod.name => e.name(),
          },
        )
        .toList(),
  };
}