简体   繁体   中英

The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'Map<String, dynamic>?'

The argument type 'Map<dynamic, dynamic>' can't be assigned to the parameter type 'Map<String, dynamic>?'.

void getData({
    required String url,
    required Map query,
  }) {
    dio.get(
      url,
      queryParameters: query,
    );
  }

Define your Map type parameters explicitely:

//                                             vvvvvvvvvvvvvvvvv
void getData({required String url, required Map<String, dynamic> query}) {
  dio.get(url, queryParameters: query);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM