Issue
I am trying to call API's in flutter but when I am defining the variable _Welcome I am getting this error. Does anyone know how to fix it?
class _PostsPageState extends State<PostsPage> {
Future<Welcome> _Welcome; //error here
@override
void initState() {
_Welcome = API_Manager().getNews();
super.initState();
}
Solution
Use late Future<Welcome> _welcome;
Answered By - Aravind Aji
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.