8000 The method 'add' isn't defined for the type 'Interceptors' · Issue #2414 · cfug/dio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
The method 'add' isn't defined for the type 'Interceptors' #2414
Closed
@francescopasin

Description

@francescopasin

Package

dio

Version

5.8.0+1

Operating-System

Windows

Adapter

Default Dio

Output of flutter doctor -v

Flutter version 3.32.0

Dart Version

3.8.0

Steps to Reproduce

Trying to add an interceptor with the following code:

 _dio.interceptors.add(CookieManager(_cookieJar));

The linter show the following error (and also the build fails):

The method 'add' isn't defined for the type 'Interceptors'.
Try correcting the name to the name of an existing method, or defining a method named 'add'.dart[undefined_method](https://dart.dev/diagnostics/undefined_method)

Expected Result

The method add should work as expected

Actual Result

Inspecting the Interceptors class definition it seems like the IDE doesn't even know what ListMixin is.
I think this could be the problem since add (I guess) is defined inside that mixin

Metadata

Metadata

Assignees

No one assigned

    Labels

    h: need triageThis issue needs to be categorizeds: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0