simple widget tree with managing data with each

This commit is contained in:
talksik
2019-05-26 00:52:01 -07:00
parent c6de0ce9b2
commit 0d9ee1c1b6
3 changed files with 67 additions and 32 deletions
+19
View File
@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
class Products extends StatelessWidget {
final List<String> products;
Products(this.products);
@override
Widget build(BuildContext context) {
return Column(
children: products
.map((elem) => Card(
child: Column(
children: <Widget>[Image.asset('assets/food.jpg'), Text(elem)],
)))
.toList(),
);
}
}