fix debug mode error and format
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
erinn 2021-05-18 18:23:07 -07:00
parent 5714713dab
commit e0a031c6d3
1 changed files with 15 additions and 11 deletions

View File

@ -54,13 +54,14 @@ class _ContactsViewState extends State<ContactsView> {
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<ContactListState>(context).isFiltered ? Icons.search_off : Icons.search),
onPressed: () {
Provider.of<ContactListState>(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<ContactListState>(context).isFiltered ? Icons.search_off : Icons.search),
onPressed: () {
Provider.of<ContactListState>(context, listen: false).filter = "";
setState(() {
showSearchBar = !showSearchBar;
});
})
],
),
floatingActionButton: FloatingActionButton(
@ -74,15 +75,18 @@ class _ContactsViewState extends State<ContactsView> {
Widget _buildFilterable() {
//todo: translate
Widget txtfield = CwtchTextField(controller: ctrlrFilter, labelText: AppLocalizations.of(context).search, onChanged: (newVal){
Provider.of<ContactListState>(context, listen: false).filter = newVal;
});
Widget txtfield = CwtchTextField(
controller: ctrlrFilter,
labelText: AppLocalizations.of(context).search,
onChanged: (newVal) {
Provider.of<ContactListState>(context, listen: false).filter = newVal;
});
return Column(children: [Padding(padding: EdgeInsets.all(2), child: txtfield), Expanded(child: _buildContactList())]);
}
Widget _buildContactList() {
final tiles = Provider.of<ContactListState>(context).filteredList().map((ContactInfoState contact) {
return ChangeNotifierProvider<ContactInfoState>.value(key: ValueKey(contact.onion), value: contact, builder: (_,__) => ContactRow());
return ChangeNotifierProvider<ContactInfoState>.value(key: ValueKey(contact.onion), value: contact, builder: (_, __) => ContactRow());
});
final divided = ListTile.divideTiles(
context: context,