Flutter Advanced : Build Beautiful Material Search App or Integrate it with Any App

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 253

  • @MinhTran-xn3kk
    @MinhTran-xn3kk 6 років тому +144

    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

    • @abodamin7820
      @abodamin7820 5 років тому +9

      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.

    • @trapeye3464
      @trapeye3464 4 роки тому +1

      agree, cause it makes me excited to watch.. because we already know the result.

  • @ayuzh7659
    @ayuzh7659 3 роки тому +2

    put.. query = suggestionList[index]; before showResults(context); in ontap function to make the query equal to the String in List

  • @smhmz
    @smhmz 4 роки тому +6

    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,
    );
    }
    }

  • @sreelalts1892
    @sreelalts1892 4 роки тому +5

    Hats off to you! Just 24 minutes gave me an INCREDIBLE amount of info! Helped me a lot!

  • @wycliffeo4656
    @wycliffeo4656 5 років тому +10

    Thanks for the wonderful tutorials , any chance of the search using API tutorial?

  • @uzairleo2910
    @uzairleo2910 4 роки тому +1

    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

  • @evicoach
    @evicoach 4 роки тому +5

    This is the best tutorial I've watched online. You're amazing 🙌

  • @toluwalopeadegunwa3947
    @toluwalopeadegunwa3947 4 роки тому +4

    This is one of the best video on flutter search that I have seen 👍

  • @jamesboye3190
    @jamesboye3190 5 років тому +8

    Good Tutorial Please where can i find an example with live json data?
    Thanks

  • @nttrn
    @nttrn 3 роки тому +1

    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!

  • @randriamarovelomanda1336
    @randriamarovelomanda1336 5 років тому +1

    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

  • @MrQooje2
    @MrQooje2 3 роки тому +4

    Wow! This is exactly what I needed. You're an MVP!
    Thanks a lot!

  • @chrisbanas9118
    @chrisbanas9118 2 роки тому

    This was the best tutorial I've ever seen

  • @SameenIslam
    @SameenIslam 4 роки тому +1

    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.

  • @gilmcglory3748
    @gilmcglory3748 6 років тому +2

    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.

  • @experimentb6449
    @experimentb6449 4 роки тому +1

    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

  • @vinceramcesoliveros6739
    @vinceramcesoliveros6739 6 років тому

    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

  • @wahyualfandi611
    @wahyualfandi611 3 роки тому

    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

  • @evicoach
    @evicoach 4 роки тому +2

    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

  • @jarvsgithub6017
    @jarvsgithub6017 2 роки тому

    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

  • @matiasgomez9416
    @matiasgomez9416 4 роки тому +2

    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,
    );
    }
    }

  • @neteshpaudel724
    @neteshpaudel724 5 років тому +1

    It does not work for the lowercase letter .Any idea to show the result whether lower or uppercase letter ?

  • @kenthinson2980
    @kenthinson2980 5 років тому

    @MTECHVIRAL Heads up you can change the font size with CMD+ and CMD- on your mac.

  • @d-apps2699
    @d-apps2699 5 років тому +2

    I loved this tutorial but I needed with Firestore.

    • @nbreuk2954
      @nbreuk2954 4 роки тому

      have you found it yet?

  • @TheShinayser
    @TheShinayser 6 років тому +1

    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

  • @AbhideepChakravarty
    @AbhideepChakravarty 3 роки тому

    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?

  • @TenzinThinley
    @TenzinThinley 4 роки тому +2

    nice video. but i cant see the source code?

  • @karansaggoo2935
    @karansaggoo2935 3 роки тому

    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 )

  • @AbdullahHattab
    @AbdullahHattab 2 роки тому

    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?

  • @adeutisunday17
    @adeutisunday17 2 роки тому

    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???

  • @vinayakshukla8197
    @vinayakshukla8197 6 років тому +14

    Please provide the source code of this

  • @majeedk100
    @majeedk100 6 років тому +2

    Thank you so much... very nice tutorial.. can you please create video deep link flutter

  • @antoniolarosa776
    @antoniolarosa776 6 років тому +1

    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

  • @dawithagos
    @dawithagos 5 років тому +2

    Awesome content. Is there a way to override the default hint text.

  • @priyanshupaliwal8548
    @priyanshupaliwal8548 3 роки тому +1

    Thank you bhaiya for this tutorial

  • @SamAllenOfficial
    @SamAllenOfficial 4 роки тому

    how to search with both capital letters and lower letters ?? and selected to pass value on raise button or something

  • @sunilk9760
    @sunilk9760 4 роки тому

    तकिया कलाम
    उम, अहं , basically ,what we can do
    overall nice going

  • @texcrac
    @texcrac 2 роки тому +1

    Incredible video, 10/10 thank you very much for this!

  • @sanali6432
    @sanali6432 6 років тому +2

    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

  • @abodamin7820
    @abodamin7820 5 років тому

    best Tutorial explaining all what a beginner need to implement in a search bar.
    great job.

  • @NishaYadav-pj5mm
    @NishaYadav-pj5mm 4 роки тому

    In visual studio code problem showing that the function 'MyApp' isn't defined. So please clear my doubt

  • @vivekjunghamal5730
    @vivekjunghamal5730 3 роки тому

    That highlighted text while typing has issues, when search is done while taking other strings than first

  • @sauravgupta1307
    @sauravgupta1307 6 років тому +1

    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

  • @samvictor2754
    @samvictor2754 3 роки тому +1

    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

    • @somebodyoulove
      @somebodyoulove 3 роки тому +1

      Hello Sam do this
      final suggestionList = query.isEmpty
      ? recentCities
      : cities.where((p) => p.toLowerCase().contains(query) && p.toLowerCase().startsWith(query)).toList();

  • @andressaszx
    @andressaszx 3 роки тому +1

    Very nice, friend. Thank you very much!

  • @vbatan
    @vbatan 3 роки тому +1

    Great job bro 👏

  • @devortion3394
    @devortion3394 4 роки тому +1

    "Navigator operation requested with a context that does not include a Navigator." i get his error when I click my search icon please help

  • @sankaranarayananp8407
    @sankaranarayananp8407 2 роки тому +1

    Nice Tutorial !!

  •  5 років тому

    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?

  • @halyan2033
    @halyan2033 5 років тому

    It's pretty clear! Thank you so much for doing this Tutorial Video!!!!! 👏👏

  • @martinmugi2257
    @martinmugi2257 6 років тому +2

    Nice tutorial.. I think it will be more clear if you implement it in pokemon app...waiting bro thanks

  • @ramdansalim3326
    @ramdansalim3326 3 роки тому +1

    cant give null in close , its showing error

  • @martinrupertbulquerin228
    @martinrupertbulquerin228 6 років тому

    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.

  • @samighasemi3333
    @samighasemi3333 3 роки тому +1

    Awesome!

  • @Moncellence
    @Moncellence 3 роки тому +1

    very thanks man , thank you

  • @cahyasulianto995
    @cahyasulianto995 5 років тому +1

    Nice tutorial..
    but i found some error..
    Flutter search delegate dosen't work when navigate back from a route
    can you help..

  • @alinakramer7356
    @alinakramer7356 3 роки тому +1

    Thank you some much, very helpful!you explain very well

  • @princeledi9930
    @princeledi9930 3 роки тому +1

    You the best bro

  • @nixonoftheyear
    @nixonoftheyear 4 роки тому

    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.

  • @vitoalvarez5416
    @vitoalvarez5416 5 років тому +1

    You are amazing. You really helped me and i understood everything you said clearly!

    • @HelloCodepur
      @HelloCodepur  5 років тому

      Thanks

    • @vitoalvarez5416
      @vitoalvarez5416 5 років тому +1

      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.

  • @sureshy4716
    @sureshy4716 5 років тому

    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.

  • @obaydullahalnumanhasib451
    @obaydullahalnumanhasib451 2 роки тому

    great tutorial. how can i add real suggestion in my search bar?

  • @astridtaw
    @astridtaw 3 роки тому +1

    Thank you. It was of great help.

  • @pepepriest5973
    @pepepriest5973 5 років тому

    Looks really good men, really easy in flutter. Gonna try it with sql or firebase

  • @paulnoris4928
    @paulnoris4928 4 роки тому

    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

  • @kushaladhikari106
    @kushaladhikari106 5 років тому

    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??

  • @rand6626
    @rand6626 5 років тому

    Excellent content, great job. The noise since 21:33 is sad because the tutorial is so useful.

  • @ritwikghosh7821
    @ritwikghosh7821 4 роки тому +1

    Amazing tutorial, loved the method of going through it :D

  • @ananthanvs4987
    @ananthanvs4987 4 роки тому

    How can I pass objects from ShowResults to Buildresuts.because I need the entire object inorder to view a detail page on tapping

  • @MuhammadUmair001
    @MuhammadUmair001 3 роки тому

    what a beauty you code, excellent

  • @hungdang38
    @hungdang38 3 роки тому +1

    Thanks ❤️ amazing tutorial

  • @SHREYASINGH-kp8kq
    @SHREYASINGH-kp8kq 3 роки тому

    Very helpful easily understandable and well explained .

  • @suptech4631
    @suptech4631 4 роки тому +1

    Thanks for the great video! It really helped me a lot!

  • @mr.d1023
    @mr.d1023 4 роки тому

    what if I use contains() instead of startsWith() . How to bold search text? Please help.

  • @shibookumar7651
    @shibookumar7651 2 роки тому

    Sir please suggest the best extension for vscode error or fixed suggestions in flutter

  • @Railwayviralvideos
    @Railwayviralvideos 4 роки тому

    Bro how to add drop-down chosen option . There are 3 box in which user choose all box then show result.

  • @hectoraguero5204
    @hectoraguero5204 5 років тому

    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].

  • @mohammadezziddin9627
    @mohammadezziddin9627 6 років тому +1

    thank you so much Pawan that you teaching us in English :D

  • @XPLORABHAY7
    @XPLORABHAY7 3 роки тому +2

    best one ❤️✨

  • @emranimam92
    @emranimam92 4 роки тому

    Thank you so much for this. I was looking for this one exactly.

  • @gokulmanohar5677
    @gokulmanohar5677 4 роки тому

    How to get the complete text of the query to show in the card rather than what you entered as query?

  • @wolfmex3012
    @wolfmex3012 4 роки тому

    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?

  • @abdurraheemabdul-hakeem3108
    @abdurraheemabdul-hakeem3108 5 років тому

    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

  • @LivDev
    @LivDev 4 роки тому +1

    awesome tutorial so easy to understand

  • @ni_kabiu_john
    @ni_kabiu_john 3 роки тому +1

    Amazing... totally awesome

  • @SalihSDemir90
    @SalihSDemir90 4 роки тому

    the last part is missing. printing query on card, not selected item

  • @amanoberoi8034
    @amanoberoi8034 4 роки тому

    How can we fetch data from search bar and list them using rest api

  • @felixtopappz7338
    @felixtopappz7338 4 роки тому

    How do one add SearchDelegate to an existing class that already extends and Another class?

  • @uzairleo2910
    @uzairleo2910 4 роки тому

    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

  • @mbrdlarun9143
    @mbrdlarun9143 5 років тому

    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?

  • @bibashkatel1090
    @bibashkatel1090 4 роки тому

    Search bar is not showing on pressing the search icon. I did the same as in video but it didnt work. Any suggestion?

  • @alexapps3008
    @alexapps3008 4 роки тому

    How to ignore UperCase or lower case letter in the search?

  • @ChristianMayrde
    @ChristianMayrde 5 років тому +1

    This was really helpful and well explained, thank you!

  • @SiddharthaVermaSID22
    @SiddharthaVermaSID22 4 роки тому

    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

  • @SampathDiss
    @SampathDiss 3 роки тому +1

    Thank you for this lesson

  • @AyushiSharmaDSA
    @AyushiSharmaDSA 4 роки тому

    Thanks so much for making this video :)

  • @lennard4454
    @lennard4454 3 роки тому +1

    thanks so much... helped me alot

  • @nishithanasar1609
    @nishithanasar1609 3 роки тому

    The search bar is not appearing at the top of the page...can anyone tell the reason

  • @wingardiumleviosa2660
    @wingardiumleviosa2660 4 роки тому +1

    u r a flutter gem boi

  • @AiDidthis.
    @AiDidthis. 4 роки тому

    what if you want implement a search bar from your Json file using this design