type function

Class type({
  1. required dynamic of,
})

Returns the class object for the receiver’s class.

Implementation

Class type({required dynamic of}) {
  if (of is NSObjectProtocol) {
    return of.performSync(SEL('class'));
  } else if (of is Type) {
    return Class(of.toString());
  } else if (of is Pointer) {
    return NSObject.fromPointer(of.cast<Void>()).performSync(SEL('class'));
  } else {
    return Class(of.runtimeType.toString());
  }
}