From 6244c06b3cee4e9c9b8ab43544b4fab0faf1d03e Mon Sep 17 00:00:00 2001 From: marcoabat Date: Mon, 7 Aug 2023 01:55:17 +0200 Subject: [PATCH] rearrange --- lib/pages/detail_checklist_page.dart | 56 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/pages/detail_checklist_page.dart b/lib/pages/detail_checklist_page.dart index f44819b..ce33c4c 100644 --- a/lib/pages/detail_checklist_page.dart +++ b/lib/pages/detail_checklist_page.dart @@ -19,11 +19,11 @@ class DetailChecklistPage extends StatefulWidget { class _DetailChecklistPageState extends State { String? pageTitle; List selectedItemIndexes = []; + TextEditingController titleController = TextEditingController(); Checklist? _checklist; late Future> _checklistFutures; late final ChecklistProvider _checklistProvider; - TextEditingController titleController = TextEditingController(); List _items = []; int? _selectedItemId; bool _titleEditMode = false; @@ -187,6 +187,33 @@ class _DetailChecklistPageState extends State { }); } + _streamBuilder( + BuildContext context, + AsyncSnapshot>> snapshot, + Checklist? checklist, + List items) { + if (pageTitle != _checklist!.title) { + WidgetsBinding.instance.addPostFrameCallback( + (_) => setState(() => pageTitle = _checklist!.title)); + } + if (snapshot.hasData) { + _items = DbHelper.resToItemList(snapshot.data!); + } + return Column( + children: [ + Text(_checklist!.description), + SizedBox( + width: 500, + height: 500, + child: ListView.builder( + itemCount: _items.length, + itemBuilder: _itemListBuilder, + ), + ), + ], + ); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -221,31 +248,4 @@ class _DetailChecklistPageState extends State { ), ); } - - _streamBuilder( - BuildContext context, - AsyncSnapshot>> snapshot, - Checklist? checklist, - List items) { - if (pageTitle != _checklist!.title) { - WidgetsBinding.instance.addPostFrameCallback( - (_) => setState(() => pageTitle = _checklist!.title)); - } - if (snapshot.hasData) { - _items = DbHelper.resToItemList(snapshot.data!); - } - return Column( - children: [ - Text(_checklist!.description), - SizedBox( - width: 500, - height: 500, - child: ListView.builder( - itemCount: _items.length, - itemBuilder: _itemListBuilder, - ), - ), - ], - ); - } }