解决 dio The name 'DefaultHttpClientAdapter' isn't a type

3 min read

报错:

The name 'DefaultHttpClientAdapter' isn't a type, so it can't be used in an 'as' expression.
Try changing the name to the name of an existing type, or creating a type with the name 'DefaultHttpClientAdapter'.

因为 DefaultHttpClientAdapter这个class写到另一个dart文件中 ,在当前文件引进下面的文件就可以解决

import 'package:dio/adapter.dart';