I am trying to make a Music Playing App. And in that app i want to implement search feature. This requires me to show list of 5 answers related to query only if the user is trying to search, else do not.
I tried to use FutureBuilder inside if statement as i am using API, but it did not work. I have tried building separate widget and then calling it inside the if statement but to no avail. Then i tried to display a simple container inside if statement but it would not show.
Here is the code:
onChanged: (value) async {
final String accessToken =
await jiosaavn.getaccesstoken();
if (selectedValue == "Artists" && value != '')
Container(
width: double.infinity,
height: double.infinity,
color: Colors.blue,
);
if (selectedValue == "Albums")
Container(
width: double.infinity,
height: double.infinity,
color: Colors.blue,
);
if (selectedValue == "Tracks" && value != '')
Container(
width: double.infinity,
height: double.infinity,
color: Colors.blue,
);
},
Even Container is not displayed. Is it possible?