Class.fromPointer constructor
Implementation
factory Class.fromPointer(Pointer<Void> ptr) {
if (ptr == nullptr) {
throw 'Can\'t initialize a Class with nullptr';
}
int key = ptr.address;
if (_cache.containsKey(key)) {
return _cache[key]!;
} else {
if (object_isClass(ptr) != 0) {
String name = class_getName(ptr).toDartString();
return Class._internal(name, ptr);
} else {
throw 'Pointer $ptr is not for Class!';
}
}
}