Created
January 9, 2019 01:53
-
-
Save lawreyios/e1fbbdd093ecd551e0875323edf223bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _buildList(BuildContext context) { | |
if (!(_searchText.isEmpty)) { | |
_filteredRecords.records = new List(); | |
for (int i = 0; i < _records.records.length; i++) { | |
if (_records.records[i].name.toLowerCase().contains(_searchText.toLowerCase()) | |
|| _records.records[i].address.toLowerCase().contains(_searchText.toLowerCase())) { | |
_filteredRecords.records.add(_records.records[i]); | |
} | |
} | |
} | |
return ListView( | |
padding: const EdgeInsets.only(top: 20.0), | |
children: this._filteredRecords.records.map((data) => _buildListItem(context, data)).toList(), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment