noSuchMethod method

  1. @override
dynamic noSuchMethod(
  1. Invocation invocation
)
override

Implements noSuchMethod to handle missing method implementations defensively

Implementation

@override
dynamic noSuchMethod(Invocation invocation) {
  // Log missing method for debugging but don't crash the app
  ObslyLogger.warn('[OBSLY] Missing method implementation: ${invocation.memberName}');

  // Return appropriate defaults based on return type
  if (invocation.isGetter || invocation.isMethod) {
    return _getDefaultReturn(invocation);
  }

  // For setters, do nothing (defensive)
  return null;
}