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.
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);
}
Subreddit
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/flutterhelp...