Home > Mobile >  The argument type 'RequestOptions' can't be assigned to the parameter type 'Opti
The argument type 'RequestOptions' can't be assigned to the parameter type 'Opti

Time:02-22

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);

CodePudding user response:

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

CodePudding user response:

After renaming it's started working

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