Search code examples
androidflutterdio

The argument type 'RequestOptions' can't be assigned to the parameter type 'Options'. i am getting error after updating dio: 3.0.9 to dio: ^4.0.1


i am getting this issue after updating libraries.Can anybody suggest me any solution.

final _result = await _dio.request<Map<String, dynamic>>('device',
    queryParameters: queryParameters,
    options: RequestOptions(
        method: 'POST',
        headers: <String, dynamic>{},
        extra: _extra,
        baseUrl: baseUrl, path: 'device'),
    data: _data);

Solution

  • The RequestOptions has been renamed to Options. You can check the entire example here.