in my opinion. You should place the demo of your app on top of the video. This will create more excitement. I always have to watch demo before learning video
for real that's how all tutorials must be, cuz it doesn't make sense to read code without seeing the results in complete manner. in the beginning and end of the video.
During my whole learning phase using ur sources one thing i realized everytime pawan bhai you are such genuine heart and minded person #reallyappreciateyourEfforts #keepItup#theFlutterGem
Clearly explain and easy to follow, I would like to ask about if we want to use endDrawer instead for transition drawer from the right. what we have to do because when I try it turn out invisible. Thank you!
what should I do guys if i want use searchDelegate in the homePage ,not like this but if i click in the button search, this SearchDelegate appear in this same page
Nice tutorial but your scope fell a bit short. You should've shown how we can filter a listview of cities after searching and returning the query. After watching this, I know how to create a searchbar with SearchDelegate and that's it. Seems a bit half-baked.
Does this work if users input a username or something like that, and like instagram be able to search for usernames without having to manually write them in like he did with the cities
Maybe this will become helpful when querying to Firestore. I used a different plugin for search, yet I have to implement it in a way its good to show its results. Thanks for the Tutorial
i will implement this searching method but i'm not using appbar on my apps, will it work without using appbar? edit : It Works, thanks a lot, this tutorial is very helpful
God bless you, thank you very much. Exactly what I wanted. You're using Android studio. I would really love all the useful flutter shortcuts keys too. Thanks
Can you have a tutorial of multiple strings in search ex. "Lorem","Lorem 1","Lorem 2","Lorem 3","Lorem 4"; and it shows the result of search all containing the data
Do a flutter build web. Then deploy the app somewhere. Then open the app in Android, on any browser. Try to do your search 3-4 times. What do you notice?
Hello Please make a video on search in flutter app on different firestore collection For eg there are three categories of vehical light , heavy , medium and have different collection in firebase And how to search throughout the app (search any category in home page )
Nice work man...I good follow up of this tutorial could be an integration with google maps api (such google places). So we can learn how to integrate with an api. Great work
Hello Sam do this final suggestionList = query.isEmpty ? recentCities : cities.where((p) => p.toLowerCase().contains(query) && p.toLowerCase().startsWith(query)).toList();
Amazing video quick question tho, how would'd you go about the search accepting ND or Nwd for new dheli (a couple of letters in the right order) and bolding those letters?
Thank you so much for this tutorial! I've been looking for this the whole time. Please implement it on your Pokemon app. I want to know how to query in ListView and then show the results on the next page.
Very thank you for this great tutorial. There is one thing that you should correct, is it wrong use query in buildResults? Because if I search 'New D' and I tap on 'New Delhi' I want to see for result text 'New Delhi' and not only what I've typed.
Thank you for the tutorial. Really its very nice. can you please make a video on how to connect with third party android SDK's . (for eg., as soon you click on the button in flutter it should display android or ios activity in app and few text fields which should send back the user input back to flutter app) Hand over the flutter view to android activity and send response back to flutter.
It was a really good video, thanks you a lot, but I have a question, it's posible to get the seleccted value on the previous widget, i mean without have to send with a navigator.pushnamed to another please ? to be more clear, to have autocomplete input on a form, select value, return to the same widget and display on the widget where I have the onTap or onPress inside the form
I am using dark mode theme , and in that theme the text color of Search is being white so i cant view what is being typed in the search bar .. How to change the color of that text??
Errors: - How Update RecentCities ? - Whats happens when press enter in search button (on keyboard) and the result is null? - How obtain the name of the suggestion taped => Solution:In buildSuggestions() => ListView.builder => inside of onTap put: suggestionList[index].
Hi! Thanks for the tutorial, However whenever I try to write in the search bar this errors occur: W/IInputConnectionWrapper( 8795): getTextBeforeCursor on inactive InputConnection W/IInputConnectionWrapper( 8795): getSelectedText on inactive InputConnection W/IInputConnectionWrapper( 8795): getTextAfterCursor on inactive InputConnection W/IInputConnectionWrapper( 8795): beginBatchEdit on inactive InputConnection Any reasons why they apprear?
pawan bhai i m little confused there where u mentioned that we do some hard coding here may i asked what if we not do hardcoding is that data fetched from any where? a little confused
Super tutorial. Thank you. I am a beginner and when I play it in AndroidStudio and launch the application ... it only shows the first letters typed and not the full name of the whole city ... And is it possible to work with a list saved separately and with several items?
in my opinion. You should place the demo of your app on top of the video. This will create more excitement. I always have to watch demo before learning video
for real that's how all tutorials must be, cuz it doesn't make sense to read code without seeing the results in complete manner.
in the beginning and end of the video.
agree, cause it makes me excited to watch.. because we already know the result.
put.. query = suggestionList[index]; before showResults(context); in ontap function to make the query equal to the String in List
import 'package:flutter/material.dart';
class SearchText extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Searchable Text"),
actions: [
IconButton(
icon: Icon(Icons.search),
onPressed: () {
showSearch(
context: context,
delegate: DataSearch(),
);
})
],
),
drawer: Drawer(),
);
}
}
class DataSearch extends SearchDelegate {
final cities = ['Ankara', 'İzmir', 'İstanbul', 'Samsun', 'Sakarya'];
var recentCities = ['Ankara'];
@override
List buildActions(BuildContext context) {
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: () {
query = "";
})
];
}
@override
Widget buildLeading(BuildContext context) {
return IconButton(
icon: AnimatedIcon(
icon: AnimatedIcons.menu_arrow,
progress: transitionAnimation,
),
onPressed: () {
close(context, null);
});
}
@override
Widget buildResults(BuildContext context) {
return Center(
child: Container(
width: 100,
height: 100,
child: Card(
color: Colors.red,
child: Center(child: Text(query)),
),
),
);
}
@override
Widget buildSuggestions(BuildContext context) {
final suggestionList = query.isEmpty
? recentCities
: cities.where((p) => p.startsWith(query)).toList();
return ListView.builder(
itemBuilder: (context, index) => ListTile(
onTap: () {
showResults(context);
},
leading: Icon(Icons.location_city),
title: RichText(
text: TextSpan(
text: suggestionList[index].substring(0, query.length),
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
children: [
TextSpan(
text: suggestionList[index].substring(query.length),
),
],
),
),
),
itemCount: suggestionList.length,
);
}
}
Thanks man
Thx a lot
Hats off to you! Just 24 minutes gave me an INCREDIBLE amount of info! Helped me a lot!
Thanks for the wonderful tutorials , any chance of the search using API tutorial?
During my whole learning phase using ur sources one thing i realized everytime
pawan bhai you are such genuine heart and minded person
#reallyappreciateyourEfforts
#keepItup#theFlutterGem
This is the best tutorial I've watched online. You're amazing 🙌
This is one of the best video on flutter search that I have seen 👍
Good Tutorial Please where can i find an example with live json data?
Thanks
Clearly explain and easy to follow, I would like to ask about if we want to use endDrawer instead for transition drawer from the right. what we have to do because when I try it turn out invisible. Thank you!
what should I do guys if i want use searchDelegate in the homePage ,not like this but if i click in the button search, this SearchDelegate appear in this same page
Wow! This is exactly what I needed. You're an MVP!
Thanks a lot!
This was the best tutorial I've ever seen
Nice tutorial but your scope fell a bit short. You should've shown how we can filter a listview of cities after searching and returning the query. After watching this, I know how to create a searchbar with SearchDelegate and that's it. Seems a bit half-baked.
Thanks so much for another very important tutorial. You have a very captive group of students, and we look forward to all of your videos.
Does this work if users input a username or something like that, and like instagram be able to search for usernames without having to manually write them in like he did with the cities
Maybe this will become helpful when querying to Firestore. I used a different plugin for search, yet I have to implement it in a way its good to show its results. Thanks for the Tutorial
i will implement this searching method but i'm not using appbar on my apps, will it work without using appbar?
edit : It Works, thanks a lot, this tutorial is very helpful
God bless you, thank you very much. Exactly what I wanted. You're using Android studio. I would really love all the useful flutter shortcuts keys too. Thanks
Can you have a tutorial of multiple strings in search ex. "Lorem","Lorem 1","Lorem 2","Lorem 3","Lorem 4"; and it shows the result of search all containing the data
Here is the code:
class Example9 extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
title: Text('Seach App'),
actions: [
IconButton(
icon: Icon(Icons.search),
onPressed: () {
showSearch(context: context, delegate: DataSearch());
},
)
],
),
drawer: Drawer(),
);
}
}
class DataSearch extends SearchDelegate {
final cities = [
"Barcelona",
"Madrid",
"Valencia",
"Malaga",
"Paris",
];
final recentCities = [
"Barcelona",
"Madrid",
];
@override
List buildActions(BuildContext context) {
// TODO: Actions for AppBar
return [
IconButton(
icon: Icon(Icons.clear),
onPressed: () {
query = "";
},
)
];
}
@override
Widget buildLeading(BuildContext context) {
// TODO: Leading icon on the left of the AppBar
return IconButton(
icon: AnimatedIcon(
icon: AnimatedIcons.menu_arrow,
progress: transitionAnimation,
),
onPressed: () {
close(context, null);
},
);
}
@override
Widget buildResults(BuildContext context) {
// TODO: Show some result based on the selection
return Container(
height: 100.0,
width: 100.0,
child: Card(
color: Colors.red,
child: Center(
child: Text(query),
),
),
);
}
@override
Widget buildSuggestions(BuildContext context) {
// TODO: Show when someone searches for something
final suggestionList = query.isEmpty
? recentCities
: cities.where((p) => p.startsWith(query)).toList();
return ListView.builder(
itemBuilder: (context, index) => ListTile(
onTap: () {
showResults(context);
},
leading: Icon(Icons.location_city),
title: RichText(
text: TextSpan(
///Bold text when you search suggestions
text: suggestionList[index].substring(0, query.length),
style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
children: [
TextSpan(
text: suggestionList[index].substring(query.length),
style: TextStyle(color: Colors.grey),
),
],
),
),
),
itemCount: suggestionList.length,
);
}
}
It does not work for the lowercase letter .Any idea to show the result whether lower or uppercase letter ?
having same issue
@MTECHVIRAL Heads up you can change the font size with CMD+ and CMD- on your mac.
I loved this tutorial but I needed with Firestore.
have you found it yet?
Is it possible to show a search bar in other widgets that not a Scaffold? For example: show a search bar in a modal bottom sheet
Do a flutter build web. Then deploy the app somewhere. Then open the app in Android, on any browser. Try to do your search 3-4 times. What do you notice?
nice video. but i cant see the source code?
Hello
Please make a video on search in flutter app on different firestore collection
For eg there are three categories of vehical light , heavy , medium and have different collection in firebase
And how to search throughout the app (search any category in home page )
thank you. can you please provide how can we use some thing like bold the text for a huge list and characters, because the substring is a limited?
Thanks for this.
But what if I want to get search results from the whole of my app and not just some list of strings???
Please provide the source code of this
Thank you so much... very nice tutorial.. can you please create video deep link flutter
Nice work man...I good follow up of this tutorial could be an integration with google maps api (such google places). So we can learn how to integrate with an api. Great work
Awesome content. Is there a way to override the default hint text.
Thank you bhaiya for this tutorial
how to search with both capital letters and lower letters ?? and selected to pass value on raise button or something
तकिया कलाम
उम, अहं , basically ,what we can do
overall nice going
Incredible video, 10/10 thank you very much for this!
Why don't you make a tutorial series of e-commerce applications and use back-end a proper app which work like Amazon or Flipkart
best Tutorial explaining all what a beginner need to implement in a search bar.
great job.
In visual studio code problem showing that the function 'MyApp' isn't defined. So please clear my doubt
That highlighted text while typing has issues, when search is done while taking other strings than first
Great Bro..Though I have not gone through your Tutorials but Thumbs up from me. I was looking for Advanced Quiz app for android tutorials
very beginner friendly buh pls am having issues with the cases... the search is case sensitive.. how can i make both the search and query same case
Hello Sam do this
final suggestionList = query.isEmpty
? recentCities
: cities.where((p) => p.toLowerCase().contains(query) && p.toLowerCase().startsWith(query)).toList();
Very nice, friend. Thank you very much!
Great job bro 👏
"Navigator operation requested with a context that does not include a Navigator." i get his error when I click my search icon please help
Have you found the solution?
Nice Tutorial !!
Amazing video
quick question tho, how would'd you go about the search accepting ND or Nwd for new dheli (a couple of letters in the right order) and bolding those letters?
It's pretty clear! Thank you so much for doing this Tutorial Video!!!!! 👏👏
Nice tutorial.. I think it will be more clear if you implement it in pokemon app...waiting bro thanks
cant give null in close , its showing error
Thank you so much for this tutorial! I've been looking for this the whole time. Please implement it on your Pokemon app. I want to know how to query in ListView and then show the results on the next page.
Awesome!
very thanks man , thank you
Nice tutorial..
but i found some error..
Flutter search delegate dosen't work when navigate back from a route
can you help..
Thank you some much, very helpful!you explain very well
You the best bro
Very thank you for this great tutorial. There is one thing that you should correct, is it wrong use query in buildResults? Because if I search 'New D' and I tap on 'New Delhi' I want to see for result text 'New Delhi' and not only what I've typed.
You are amazing. You really helped me and i understood everything you said clearly!
Thanks
But i have a question, if in the build results i want to change to another screen when the result is tapped, how should i do it? Thanks in advance.
Thank you for the tutorial. Really its very nice.
can you please make a video on how to connect with third party android SDK's . (for eg., as soon you click on the button in flutter it should display android or ios activity in app and few text fields which should send back the user input back to flutter app) Hand over the flutter view to android activity and send response back to flutter.
great tutorial. how can i add real suggestion in my search bar?
Thank you. It was of great help.
Looks really good men, really easy in flutter. Gonna try it with sql or firebase
It was a really good video, thanks you a lot, but I have a question, it's posible to get the seleccted value on the previous widget, i mean without have to send with a navigator.pushnamed to another please ? to be more clear, to have autocomplete input on a form, select value, return to the same widget and display on the widget where I have the onTap or onPress inside the form
I am using dark mode theme , and in that theme the text color of Search is being white so i cant view what is being typed in the search bar .. How to change the color of that text??
Excellent content, great job. The noise since 21:33 is sad because the tutorial is so useful.
Amazing tutorial, loved the method of going through it :D
How can I pass objects from ShowResults to Buildresuts.because I need the entire object inorder to view a detail page on tapping
what a beauty you code, excellent
Thanks ❤️ amazing tutorial
Very helpful easily understandable and well explained .
Thanks for the great video! It really helped me a lot!
what if I use contains() instead of startsWith() . How to bold search text? Please help.
Sir please suggest the best extension for vscode error or fixed suggestions in flutter
Bro how to add drop-down chosen option . There are 3 box in which user choose all box then show result.
Errors:
- How Update RecentCities ?
- Whats happens when press enter in search button (on keyboard) and the result is null?
- How obtain the name of the suggestion taped => Solution:In buildSuggestions() => ListView.builder => inside of onTap put: suggestionList[index].
thank you so much Pawan that you teaching us in English :D
best one ❤️✨
Thank you so much for this. I was looking for this one exactly.
How to get the complete text of the query to show in the card rather than what you entered as query?
Hi! Thanks for the tutorial, However whenever I try to write in the search bar this errors occur:
W/IInputConnectionWrapper( 8795): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 8795): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper( 8795): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 8795): beginBatchEdit on inactive InputConnection
Any reasons why they apprear?
Great video! Any idea how to add a unique subtitle for the listile? I’ve implemented a subtitle but when I query, the subtitles don’t match its title
awesome tutorial so easy to understand
Amazing... totally awesome
the last part is missing. printing query on card, not selected item
How can we fetch data from search bar and list them using rest api
How do one add SearchDelegate to an existing class that already extends and Another class?
pawan bhai i m little confused there where u mentioned that we do some hard coding here may i asked what if we not do hardcoding is that data fetched from any where? a little confused
Super tutorial. Thank you.
I am a beginner and when I play it in AndroidStudio and launch the application ... it only shows the first letters typed and not the full name of the whole city ...
And is it possible to work with a list saved separately and with several items?
Search bar is not showing on pressing the search icon. I did the same as in video but it didnt work. Any suggestion?
How to ignore UperCase or lower case letter in the search?
This was really helpful and well explained, thank you!
can we not use search delegate in body of app?
I was trying to call this from a sliverAppBar in the body of scaffold, which has another appbar
Thank you for this lesson
Thanks so much for making this video :)
thanks so much... helped me alot
The search bar is not appearing at the top of the page...can anyone tell the reason
u r a flutter gem boi
what if you want implement a search bar from your Json file using this design