DevStack06/Flutter-Blog-App

the argument type 'Object' can't be assigned to the parameter type 'ImageProvider<Object>?

Pendyalashivasai opened this issue · 2 comments

image

its keeps showing "the argument type 'Object' can't be assigned to the parameter type 'ImageProvider?' ".

and also
image

its giving the error while initializing the _imagefile

" Non-nullable instance field '_imagFile" must be initialized"

class RestClient {
final dio = Dio();

void getHttp() async {
final response = await dio.get('https://dart.dev');
print("getHttp: $response");
}

void getTasks() async {
final response = await dio.get(
'https://5d42a6e2bc64f90014a56ca0.mockapi.io/api/v1/tasks',
);
print("getTasks: $response");
}

Future<List> getTasksz() async {
final response = await dio.get(
'https://5d42a6e2bc64f90014a56ca0.mockapi.io/api/v1/tasks',
);
print("getTasksz: $response");
final List data = response.data;
return data.map((json) => UserDetails.fromJson(json)).toList();
}

Future createTask(UserDetails user) async {
final response = await dio.post(
'https://5d42a6e2bc64f90014a56ca0.mockapi.io/api/v1/tasks',
data: user.toJson(),
);

print("createtask: $response");
return UserDetails.fromJson(response.data);

}
}

Future _fetchData() async{
nameList = await client.getTasksz();
print("NameList: $nameList");
}