dart-reddit
                                
                                 dart-reddit copied to clipboard
                                
                                    dart-reddit copied to clipboard
                            
                            
                            
                        'depth' isn't defined for the type 'FilterableQuery'.
I try to fetch comments for a post with the provided example code:
reddit.sub("dartlang").comments("2ek93l").depth(3).fetch().then(print);
"depth(3)" is marked as error with following message:
The method 'depth' isn't defined for the type 'FilterableQuery'. Try correcting the name to the name of an existing method, or defining a method named 'depth'. dart(undefined_method)
reddit version: 0.6.0 [✓]Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E266, locale de-DE) [✓] Xcode - develop for iOS and macOS (Xcode 11.5)
Weird. It should be handled by the noSuchMethod implementation. Is that no longer correct Dart? It's been a long while.
Well alterntively, .depth(3) is the same as .filter("depth", 3)..
  @override
  noSuchMethod(Invocation inv) {
    if (inv.isMethod == false) {
      return new NoSuchMethodError(
          this, inv.memberName, inv.positionalArguments, inv.namedArguments);
    }
    if (inv.positionalArguments.length > 1 || inv.namedArguments.length > 0) {
      throw new StateError(
          "Filter methods take zero or one positional arguments.");
    }
    String symbol = inv.memberName.toString();
    String f = symbol.substring(8, symbol.length - 2);
    return filter(f,
        inv.positionalArguments.isEmpty ? null : inv.positionalArguments.first);
  }