Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type 'Future<dynamic>' is not a subtype of type 'Future<Response<dynamic>>' #1

Closed
arden opened this issue Apr 27, 2018 · 11 comments
Closed

Comments

@arden
Copy link

arden commented Apr 27, 2018

[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
type 'Future<dynamic>' is not a subtype of type 'Future<Response<dynamic>>' where
  Future is from dart:async
  Future is from dart:async
  Response is from package:dio/src/Response.dart

#0      Dio._onError (package:dio/src/Dio.dart:526:12)
#1      Dio._makeRequest.<anonymous closure> (package:dio/src/Dio.dart:420:28)
#2      Dio._checkIfNeedEnqueue (package:dio/src/Dio.dart:554:22)
#3      Dio._makeRequest (package:dio/src/Dio.dart:416:35)
<asynchronous suspension>
#4      Dio._request.<anonymous closure> (package:dio/src/Dio.dart:316:16)
#5      Dio._checkIfNeedEnqueue (package:dio/src/Dio.dart:554:22)
#6      Dio._request (package:dio/src/Dio.dart:287:31)
<asynchronous suspension>
#7      Dio.request (package:dio/src/Dio.dart:270:12)
<asynchronous suspension>
#8      Dio.get (package:dio/src/Dio.dart:62:12)
#9      UserApi.getUser (package:saytoken_flutter/api/user_api.dart:12:31)
<asynchronous suspension>
#10     _LoginPageState.login (package:<…>
[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
DioError [DioErrorType.DEFAULT]: type 'Future<dynamic>' is not a subtype of type 'Future<Response<dynamic>>' where
  Future is from dart:async
  Future is from dart:async
  Response is from package:dio/src/Response.dart
#0      Dio.resolve (package:dio/src/Dio.dart:112:21)
#1      Dio._onSuccess (package:dio/src/Dio.dart:509:18)
#2      Dio._makeRequest.<anonymous closure> (package:dio/src/Dio.dart:398:57)
#3      Dio._checkIfNeedEnqueue (package:dio/src/Dio.dart:554:22)
#4      Dio._makeRequest (package:dio/src/Dio.dart:393:33)
<asynchronous suspension>
#5      Dio._request.<anonymous closure> (package:dio/src/Dio.dart:316:16)
#6      Dio._checkIfNeedEnqueue (package:dio/src/Dio.dart:554:22)
#7      Dio._request (package:dio/src/Dio.dart:287:31)
<asynchronous suspension>
#8      Dio.request (package:dio/src/Dio.dart:270:12)
<asynchronous suspension>
#9      Dio.get (package:dio/src/Dio.dart:62:12)
#10     UserApi.getUser (package:saytoken_flutter/ap<…>
@wendux
Copy link
Contributor

wendux commented Apr 27, 2018

已修复,请升级到0.0.9重试.

@Yaxian
Copy link

Yaxian commented Jul 18, 2018

Hi, @wendux
I meet this issue with version 0.1.3, when I call dio.download method.
env:

  • dio: ^0.1.3
  • Flutter: Channel beta, v0.5.1

but version 0.0.14 works fine.

@wendux
Copy link
Contributor

wendux commented Jul 19, 2018

@Yaxian fixed, please update to 0.1.4 and try again.

@fly512 fly512 mentioned this issue Jan 7, 2019
@zhouxianjun
Copy link

在2.1.7版本中,使用lock并且使用泛型response则会导致类型不匹配错误,初步原因:
image
在980行enqueue这个函数并没有声明泛型类型。
image

@zhouxianjun
Copy link

@wendux 请查看下

@lucien-theron
Copy link

I get this exception by simply returning: .catchError((error, stackTrace) => Future.error(error, stackTrace)).

@codekeyz
Copy link

codekeyz commented Oct 12, 2021

@eelishiram @aboutlan This PR: #1296 fixes this.

AlexV525 added a commit that referenced this issue Feb 13, 2023
Co-authored-by: SEUNGHWANLEE <seunghwanly@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants