Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
How to use 2 variables in for in loop
Post Flair (click to view more posts with a particular flair)
Post Body

Hey guys I wanted to use two variables in a "for in loop" please help:

I wanted to use "contents" and "prices" in same loop and am unable to do so after a lot of efforts please help me to get through this

_buildExpandableContent(Restaurant restro) {
List<Widget> columnContent = [];
List ok=[];
// for (String price in restro.prices)
// ok = price;
for (String content in restro.contents) {
columnContent.add(
new Card(
elevation: 5,
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.all(5),
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: Image.asset(
"asset/aa.jpg",
scale: 7,
),
),
),
Container(
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Column(
children: [
Text(content),
Text(ok),
],
)),
SizedBox(
width: MediaQuery.of(context).size.width * 0.4,
),
Icon(CupertinoIcons.ellipsis_circle_fill),
],
),
),
),
);
}

return columnContent;
}

class Restaurant {
final String title;
List<String> contents = [];
List<String> prices = [];
Restaurant(this.title, this.contents, this.prices);
}

https://pastebin.com/vb9vPhxC

Author
Account Strength
70%
Account Age
3 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,038
Link Karma
206
Comment Karma
3,769
Profile updated: 22 hours ago
Posts updated: 3 days ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago