part of 'index.dart'; typedef DocumentKey = GlobalKey; class DocumentPage extends StatefulPage { const DocumentPage({super.key}); @override State createState() => FREDocumentPageState(); } class FREDocumentPageState extends PageState { DocumentPageModel model = DocumentPageModel(); @override Widget build(BuildContext context) { final String title = FFLocalizations.of(context).getVariableText( enText: 'Documents', ptText: 'Documentos', ); final theme = FlutterFlowTheme.of(context); return Scaffold( backgroundColor: theme.primaryBackground, appBar: buildAppBar(title, context), body: buildBody(context), ); } @override void initState() { super.initState(); } Widget buildBody(BuildContext context) { return FutureBuilder( future: initAsync(), builder: (context, snapshot) { return DocumentManagerScreen(model: model); }, ); // return DocumentViewScreen(document: documents.first); } Future initAsync() async { final documents = await model.generateDocuments(model.page, model.query); final categories = await model.generateCategories(model.documents); model.documents = documents.$2; model.categories = categories; log('-> generateDocuments: $documents'); log('-> generateCategories: $categories'); } }