hasMethod abstract method

bool hasMethod(
  1. String methodName
)

Checks if this class or mixin declares a method with the given methodName.

Returns true if the method exists, false otherwise.

Example

if (clazz.hasMethod('toString')) {
  print('Method "toString" exists');
}

Implementation

bool hasMethod(String methodName);