Adding a search filter to a listview in FlutterFlow

Поділитися
Вставка
  • Опубліковано 30 лис 2024
  • I couldn't find a clean and easy tutorial to add a quick search filter to a listview in flutterflow, so created this video on how I did it.
    It uses a custom function and some conditional visibility to hide and show items in a list view.

КОМЕНТАРІ • 92

  • @chisomomutale5736
    @chisomomutale5736 Рік тому +9

    So this Man came, upload one very useful tutorial and disappeared

    • @heyimrith
      @heyimrith 10 місяців тому +1

      Yea

    • @mariomini
      @mariomini 7 місяців тому +1

      There must be a meme for that ;)

  • @mariomini
    @mariomini 7 місяців тому +2

    Really good tutorial, very clear. I'll just add that in newer versions of FF you will get an error if you make any of the arguments nullable so it's worth getting rid of that straight away. I'll also say if you want to search across multiple fields, use the Combine Text action to pass them all across to textSearchIn in one go

    • @markh-thai
      @markh-thai 6 місяців тому +2

      this one comment saved me…. and the ‘combine text’ MAGIC 🎉

  • @comandeoleme
    @comandeoleme 6 місяців тому +1

    Congratulations on the content, it helped me on the other side of the world. I live in Manaus, capital of Amazonas in Brazil.

  • @jaimegomez5314
    @jaimegomez5314 11 місяців тому

    Excellent Video respected gentleman, I've been searching for this thing for a lot of time, but you gave me the answer. Thanks a lot and congratulations!!!

  • @stefanhillbrand4438
    @stefanhillbrand4438 11 місяців тому

    Thank you. What a simple and elegant solution.

  • @IspyrGameDev
    @IspyrGameDev Рік тому +1

    Elegant and simple solution, even beats the built in Simple Search! Thx very much! The only issue I'm having is that when using GridView it doesn't adjust the contents properly.

    • @ahmedyehia4846
      @ahmedyehia4846 Рік тому +1

      yes same as me

    • @IspyrGameDev
      @IspyrGameDev Рік тому +1

      @@ahmedyehia4846 I ended up having to use a "wrap" widget

    • @ahmedyehia4846
      @ahmedyehia4846 Рік тому

      @@IspyrGameDev yes , but it's look not good

  • @xyzpqr181
    @xyzpqr181 Рік тому +1

    Very well explained Jay ! 👏 thanks 🙌

  • @mario7572
    @mario7572 7 місяців тому +1

    Great job sir. Thank you for the help.

  • @jean-francoisriera8723
    @jean-francoisriera8723 5 місяців тому

    A very pleasant and efficace solution ! Bravo !! Do you how we could count the visible elements ? Thanks !

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

    Thank you! that's exactly what I was looking for, you were so helpful 👍

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

    Thanks a lot. The video is perfectly made and very clear. A question for a beginner: what's different beetwin this method filter and using ALGOIA search services? THANKS FOR THIS VIDEO

    • @edgard6801
      @edgard6801 Рік тому

      Algolia is very expensive.

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

    great explain, please upload more flutterflow videos. Thanks You!

  • @occisoundead4775
    @occisoundead4775 Рік тому

    Straight to the point, thank you good sir.

  • @simon-maddox
    @simon-maddox Рік тому +3

    Just to say that this custom function code fails as of v4 (on 19th Nov 23). The AI helped correct it though to include the required null checking:
    // search for a string in another string
    if (textSearchFor == null || textSearchIn == null) {
    return false;
    }
    return textSearchIn.toLowerCase().contains(textSearchFor.toLowerCase());

    • @JoshComninellis
      @JoshComninellis Рік тому +1

      Thank you so much! I had this problem and had no idea how to fix it!

    • @mardoniorodrigues11
      @mardoniorodrigues11 10 місяців тому +1

      Thanks

    • @JoshComninellis
      @JoshComninellis 10 місяців тому +1

      I'm really surprised that this is not natively available in the app. I came from Bubble and it had this feature.

  • @PrestaVideo
    @PrestaVideo Рік тому +1

    Thank you very much for your video; How to have a search field that filters results based on two separate fields ?

    • @antonypbsilva
      @antonypbsilva Рік тому

      Did you could use the function textSearchIn?

  • @AldrichCarrasco
    @AldrichCarrasco 5 місяців тому

    Excellent. I've implemented without problem but I've like to search by 2 fields, like name and lastname, how can I achieve this?

  • @FlutterFlow-y4u
    @FlutterFlow-y4u 9 місяців тому +1

    Dude, you are the best.

  • @ermanozkaya
    @ermanozkaya Рік тому +1

    Thank you so much for this tutorial.

  • @shaemalcolm6349
    @shaemalcolm6349 11 місяців тому

    OMG this is exactly what I was looking for! I checked out your website and couldn't find any contact info for you, but do you do consultations? Is there any way to book a few hours with you to review my app in FlutterFlow?

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

    Thanks for sharing this! Is there a way to use a filter on a list thats not using Firebase? (My App must work offline, thats why..) Like apply the "textSearchIn" to the widget Name or a local state variable? Thank you.

  • @damo56
    @damo56 2 роки тому +2

    Thanks bro🤩🤩🤩Working 100%💯💯💯

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

    Hi. How might you do this with an external api?

  • @j.slowly8010
    @j.slowly8010 11 місяців тому

    Amazing, so easy actually, thanks!

  • @joaovitorcordeiro7757
    @joaovitorcordeiro7757 Рік тому

    This is really good and very helpful! Your video is based on Document data, we need this same functionality when we use API, somehow that VIEW FROM SOURCE doesn't show up when working with API data, which is crucial. Is that on the way or any specific way to achieve this with API data, please guide or share a tutorial around that.

  • @shanfts
    @shanfts Рік тому

    Just saved my life. Thanks😇🥰

  • @MarmEatzADM
    @MarmEatzADM 7 місяців тому

    Thank you, Jay!

  • @efranlacerda
    @efranlacerda Рік тому

    Excelente vídeo, qual api foi usada?

  • @russellmolimock
    @russellmolimock 2 місяці тому

    This only works for me if I tap inside the ListView before searching, and also hit enter after typing in the search text. Update on text change is definitely on though. It should be passive but it's not. Any ideas what I might be doing wrong? It's as if flutterflow doesn't bother with the visibility conditional until you click into the widget doing the query.

    • @russellmolimock
      @russellmolimock 2 місяці тому

      I at least got around the fact that it would only update the query after clicking into the listView. I also toggled on the textField attribute 'update page on focus change' and turned off autofocus. This means users have to click on the textfield in order to type in the first place, and that triggers the update on focus change. Basically update on text change doesn't work. I added a 'send' iconButton next to the textField that does nothing, but if users don't realize they have to hit enter they can hit that and since it changes the focus of the field it also updates the page. If anyone else has a better work around please let me know!

  • @MarmEatzADM
    @MarmEatzADM 7 місяців тому

    Thank you Jay!

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

    Thank you for a great video. How could you search across multiple fields?

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

      I know this is response comes late, but what I did is for the textSearchIn use the combine text feature and just added the different fields I am looking to search

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

      @@johnkrueger2604 will you be able to post the snippet or share the code somewhere? ie codebin

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

      @@johnkrueger2604 Can you be able to share what you did ? Thank you very much

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

      @@elmehdibelyasmine942 Just follow the guide in the video and use the native combine text feature within FF to add all the fields you'd like to search to the textSearchIn input.

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

      @@bigdata9605 No code snippet required. Just use the native combine text feature within FF to add all the fields you'd like to search.

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

    Thanks for this wonder video. I have a doubt though, am i gonna get result if search numbers as well instead of text??

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

    I was looking for this, thank you, I have a question is there away to make a Range Slider in flutterFlow and show the results base on that, thanks.

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

      Hi @amine - it's possible.
      You can do it using conditional visibility on the list item as long as you've got a numeric value to compare to the slider. Otherwise you'd need to create a function (like in this example) where you're comparing the value of the list slider to a value in your list view item.

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

    Can you do the same video but connecting to an API?

  • @drearystate
    @drearystate Рік тому

    How would you use this filter with flippable cards?

  • @AMAL-mr7ko
    @AMAL-mr7ko 11 місяців тому

    Really helpful....really appriciate it

  • @ajjayaroraa
    @ajjayaroraa 10 місяців тому

    lovely.. worked like a charm.

  • @ahmedyehia4846
    @ahmedyehia4846 Рік тому +1

    amazing one

  • @selfmasterytv
    @selfmasterytv 8 місяців тому

    when I search for something, it keeps it showing but the the other list items are emptied but they are still there, why is it happening?

  • @DiegoSerranoBst
    @DiegoSerranoBst 10 місяців тому

    super! You saved me some time to think :)

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

    Thank you for your tutorial. Awsesome.
    However I have a question concerning adding a second argument like textSearchIn2 because I have two fields to search in : title and subtitle because they are separated collections but in same container.
    I put another line before the return boolean function and that take in account one argument but not both. How can I fix that ? thank you

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

    Great video. Thanks.

  • @arfsystems
    @arfsystems Рік тому

    Thank you!

  • @jaguarconsultoriadigital8147
    @jaguarconsultoriadigital8147 7 місяців тому

    Very good.

  • @yevheniidubinin8362
    @yevheniidubinin8362 9 місяців тому

    good idea

  • @yuvzohar
    @yuvzohar 9 місяців тому

    great tutorial. thanks

  • @謝沛倪-f1m
    @謝沛倪-f1m 8 місяців тому

    so helpful💖

  • @dementovoid2255
    @dementovoid2255 Рік тому

    Hello, I have been trying to follow this tutorial, but the search filter only seems to update once I move to another screen and come back to the main screen (doesn't update in real time, only after switching screens). What should I try to fix this?

    • @dementovoid2255
      @dementovoid2255 Рік тому

      Sorry, I got it now, I forgot to add the wait delay

  • @bedoyb
    @bedoyb Рік тому

    THIS VIDEO IS AMAZING YOUR MY FATHER

  • @legotron369
    @legotron369 11 місяців тому

    thank you so much! what a giga chad.

  • @bobsteele6563
    @bobsteele6563 Рік тому

    Thanks, worked great

  • @matewz
    @matewz 9 місяців тому

    Sir. THANK YOU!!

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

    Excelente vídeo, justo lo que necesitaba , gracias !!

  • @allanrouse8782
    @allanrouse8782 Рік тому +1

    Perfect! thanks!

  • @TheGrozzoXD
    @TheGrozzoXD Рік тому

    thank you bro, excelent

  • @tiberiozz5693
    @tiberiozz5693 Рік тому

    thank you !!

  • @KhoaNguyen-ux5lp
    @KhoaNguyen-ux5lp 2 роки тому

    Thank you for sharing

  • @dhananjayakumarpadmanaban8951
    @dhananjayakumarpadmanaban8951 9 місяців тому

    Thanks alot

  • @GaborSzabo-g1y
    @GaborSzabo-g1y 7 місяців тому

    thanks

  • @LawrenceAfable-y2g
    @LawrenceAfable-y2g 11 місяців тому

    It works to me, thankss

  • @AsAs-ly6fz
    @AsAs-ly6fz 2 роки тому

    Hello, thank you for this video and your sharing! do you know how to ignore accents? (éèôùëêà) thank you in advance!

  • @salahmohamed5678
    @salahmohamed5678 Рік тому

    Thanks 😍

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

    muito bom, melhora muito a busca. Parabens

  • @aaronshailrepair
    @aaronshailrepair Рік тому

    It says my code has errors even though I copied it exactly

    • @FMotivated
      @FMotivated Рік тому

      uncheck all the nullable values in function and arguments too.

  • @paulocymbaum1566
    @paulocymbaum1566 8 місяців тому

    Why are you whispering mate?