You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
860 B
27 lines
860 B
import 'package:flutter/material.dart';
|
|
import 'package:thesis_shop/models/product.dart';
|
|
import 'package:thesis_shop/screens/product_list/product_item.dart';
|
|
|
|
const _productPlaceholder = [
|
|
Product(title: 'Bananen', price: 3),
|
|
Product(title: 'Äpfel', price: 2),
|
|
Product(title: 'Birnen', price: 2.5),
|
|
Product(title: 'Kirschen', price: 1.2),
|
|
];
|
|
|
|
class ProductListScreen extends StatelessWidget {
|
|
const ProductListScreen({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
const products = _productPlaceholder;
|
|
return Scaffold(
|
|
appBar: AppBar(title: const Text('Thesis Shop')),
|
|
body: ListView.separated(
|
|
itemCount: products.length,
|
|
itemBuilder: (context, index) => ProductItem(product: products[index]),
|
|
separatorBuilder: (context, _) => const Divider(),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|