toMap method

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

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "async": async,
    "crossOrigin": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => crossOrigin?.toNativeValue(),
      EnumMethod.value => crossOrigin?.toValue(),
      EnumMethod.name => crossOrigin?.name(),
    },
    "defer": defer,
    "id": id,
    "integrity": integrity,
    "noModule": noModule,
    "nonce": nonce,
    "referrerPolicy": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => referrerPolicy?.toNativeValue(),
      EnumMethod.value => referrerPolicy?.toValue(),
      EnumMethod.name => referrerPolicy?.name(),
    },
    "type": type,
  };
}