part of 'index.dart'; List generateDocuments(int count) { String str() => randomString(8, 8, true, true, true); Color color() => randomColor(); return List.generate( count, (index) => Document( title: 'Lorem Ipsum et Cetera $index', category: Category(color: color(), title: str()), to: str(), from: str(), createdAt: '00/00/0000', updatedAt: '00/00/0000', ), ); } List generateCategories(List documents) { final Map categoryMap = {}; for (var document in documents) { final category = document.category; if (!categoryMap.containsKey(category.title)) { categoryMap[category.title] = category; } } return categoryMap.values.toList(); } class FREDocumentPage extends StatefulPage { const FREDocumentPage({super.key}); @override State createState() => _FREDocumentPageState(); } class _FREDocumentPageState extends PageState { @override Widget build(BuildContext context) { final String title = FFLocalizations.of(context) .getVariableText(enText: 'Documents', ptText: 'Documentos'); return Scaffold( appBar: buildAppBar(title, context), body: buildBody(context), ); } late List documents; late List categories; @override void initState() { super.initState(); documents = generateDocuments(20); categories = generateCategories(documents); } Widget buildBody(BuildContext context) { return DocumentManagerScreen( documents: documents, categories: categories, ); // return DocumentViewScreen(document: documents.first); } }