From e0a031c6d3a172631e4975a05ddaa9a3c8abf2c0 Mon Sep 17 00:00:00 2001 From: erinn Date: Tue, 18 May 2021 18:23:07 -0700 Subject: [PATCH] fix debug mode error and format --- lib/views/contactsview.dart | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/views/contactsview.dart b/lib/views/contactsview.dart index 34191a1..fc0138b 100644 --- a/lib/views/contactsview.dart +++ b/lib/views/contactsview.dart @@ -54,13 +54,14 @@ class _ContactsViewState extends State { onPressed: _debugFakeMessage, ), IconButton( - // need both conditions for displaying initial empty textfield and also allowing filters to be cleared if this widget gets lost/reset - icon: Icon(showSearchBar || Provider.of(context).isFiltered ? Icons.search_off : Icons.search), - onPressed: () { - Provider.of(context).filter = ""; - setState((){showSearchBar = !showSearchBar;}); - } - ) + // need both conditions for displaying initial empty textfield and also allowing filters to be cleared if this widget gets lost/reset + icon: Icon(showSearchBar || Provider.of(context).isFiltered ? Icons.search_off : Icons.search), + onPressed: () { + Provider.of(context, listen: false).filter = ""; + setState(() { + showSearchBar = !showSearchBar; + }); + }) ], ), floatingActionButton: FloatingActionButton( @@ -74,15 +75,18 @@ class _ContactsViewState extends State { Widget _buildFilterable() { //todo: translate - Widget txtfield = CwtchTextField(controller: ctrlrFilter, labelText: AppLocalizations.of(context).search, onChanged: (newVal){ - Provider.of(context, listen: false).filter = newVal; - }); + Widget txtfield = CwtchTextField( + controller: ctrlrFilter, + labelText: AppLocalizations.of(context).search, + onChanged: (newVal) { + Provider.of(context, listen: false).filter = newVal; + }); return Column(children: [Padding(padding: EdgeInsets.all(2), child: txtfield), Expanded(child: _buildContactList())]); } Widget _buildContactList() { final tiles = Provider.of(context).filteredList().map((ContactInfoState contact) { - return ChangeNotifierProvider.value(key: ValueKey(contact.onion), value: contact, builder: (_,__) => ContactRow()); + return ChangeNotifierProvider.value(key: ValueKey(contact.onion), value: contact, builder: (_, __) => ContactRow()); }); final divided = ListTile.divideTiles( context: context,