fix debug mode error and format
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
5714713dab
commit
e0a031c6d3
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue