So I'm getting media fields from the Instagram API and trying to display the most recent 6 posts. it works fine, even if the posts in the account are more than 6 I only display 6 because my item count is 6 the problem is if the account has less than 6 posts I'll get an error. so i wanna make the item count dynamic but cant go over 6
CodePudding user response:
You can use directly account_post_count or something, I don't know what Instagram API shares, like this in ListView.builder widget:
itemCount: account_post_count > 6 ? 6 : account_post_count