import 'package:flutter/material.dart'; import 'package:oc_front/core/models/workspace_local.dart'; import 'package:oc_front/main.dart'; import 'package:oc_front/models/search.dart'; import 'package:oc_front/widgets/items/item_row.dart'; class CatalogWidget extends StatefulWidget { double? itemWidth; bool readOnly = false; final List? items; CatalogWidget ({ Key? key, this.items, this.itemWidth, this.readOnly = false }): super(key: key); @override CatalogWidgetState createState() => CatalogWidgetState(); } class CatalogWidgetState extends State { @override Widget build(BuildContext context) { var items = widget.items ?? WorkspaceLocal.items; List itemRows = items.map((e) => ItemRowWidget( readOnly: widget.readOnly, contextWidth: widget.itemWidth ?? getMainWidth(context), item: e)).toList(); return Column( children: itemRows); } }