oc-front/lib/widgets/catalog.dart

17 lines
786 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
2024-07-17 13:28:02 +02:00
import 'package:oc_front/core/models/workspace_local.dart';
import 'package:oc_front/models/search.dart';
import 'package:oc_front/widgets/items/item_row.dart';
class CatalogWidget extends StatefulWidget {
final List<AbstractItem>? items;
CatalogWidget ({ Key? key, this.items }): super(key: key);
@override CatalogWidgetState createState() => CatalogWidgetState();
}
class CatalogWidgetState extends State<CatalogWidget> {
@override Widget build(BuildContext context) {
var items = widget.items ?? WorkspaceLocal.items;
List<ItemRowWidget> itemRows = items.map((e) => ItemRowWidget(contextWidth: MediaQuery.of(context).size.width, item: e)).toList();
return SingleChildScrollView( child: Column( children: itemRows) );
}
}