? AppBar(
backgroundColor: Colors.white,
title: TextField(
onChanged: (value) {
print("000$value");
setState(() {
if (value.isNotEmpty) {
serchlist = [];
for (int u = 0; u < notedata.length; u++) {
String title = notedata[u]['TITLE'];
String subject = notedata[u]['NOTES'];
int color = notedata[u]['COLORS'];
if (title
.toLowerCase()
.contains(value.toLowerCase()) ||
subject
.toUpperCase()
.contains(value.toUpperCase()) ) {
print("111$title");
serchlist.add(notedata[u]);
} else {}
}
} else {
serchlist = notedata;
}
});
},
autofocus: true,
decoration: InputDecoration(
border: InputBorder.none,
hintText: "🔍 search",
suffixIcon: IconButton(
onPressed: () {
setState(() {
issearch = false;
});
},
icon: Icon(
Icons.close,
color: Colors.black,
)),
)),
)
: AppBar(
leading: IconButton(onPressed: () {}, icon: Icon(Icons.menu)),
actions: [
IconButton(
onPressed: () {
setState(() {
issearch = true;
});
},
icon: Icon(Icons.search_sharp)),
IconButton(onPressed: () {}, icon: Icon(Icons.more_vert)),
],
backgroundColor: Colors.orange.shade500,
elevation: 5,
title: Text("Notes",
style: TextStyle(fontFamily: "regular", fontSize: 26))),
how I pass colors of container in search method.
2
Answers
edit your code checkout bellow code.
Send any of the three parameter through search and get result from the server
As from the problem I understand user can search by colour,subject or titles simply let user put any of the things as input and you can search from the database which ever parameter it matches and then return it to the API or user. But make sure you have implemented this on server side.