unwrapInterpreterValue static method

Object? unwrapInterpreterValue(
  1. Object? value
)

Unwrap an interpreter value to its native representation.

Note: Lists and Maps are NOT recursively unwrapped because doing so destroys Dart's reified generic type information. For example, Map<String, String> would become Map<Object?, Object?> after .map(). If a callback returns a List/Map containing BridgedInstance values, the generated bridge code must handle the element-level unwrapping explicitly.

Implementation

static Object? unwrapInterpreterValue(Object? value) {
  if (value is BridgedInstance) {
    return value.nativeObject;
  }
  if (value is BridgedEnumValue) {
    return value.nativeValue;
  }
  return value;
}