Flutter Tutorial - AutoComplete TextField & AutoComplete Search TextField With JSON Data

Поділитися
Вставка
  • Опубліковано 23 лип 2024
  • Create an AutoComplete TextField to search JSON data based on suggestions in Flutter.
    Click here to Subscribe to Johannes Milke: ua-cam.com/users/JohannesMilke...
    👉 12 Week Flutter Training | heyflutter.com
    👉 Flutter Masterclass Courses | heyflutter.com/masterclass
    Source Code | github.com/JohannesMilke/type...
    My Courses | heyflutter.com
    Follow Newsletter | johannesmilke.com/newsletter
    SUBSCRIBE HERE
    bit.ly/JohannesMilke
    SUPPORT & SPONSOR ME
    github.com/sponsors/JohannesM...
    RESOURCES
    Search Delegate & Search Bar Tutorial: • Flutter Tutorial - Sea...
    Search & Filter In ListView Tutorial: • Flutter Tutorial - Sea...
    Reorderable ListView Tutorial: • Flutter Tutorial - Reo...
    Voice Recognition Tutorial: • Flutter Tutorial - Spe...
    TextField Tutorial: • Flutter Tutorial - Tex...
    Pagination & Infinite Scrolling Tutorial: • Flutter Tutorial - Pag...
    Pull To Refresh Tutorial: • Flutter Tutorial - Pul...
    FutureBuilder - Load JSON Tutorial: • Flutter Tutorial - Fut...
    Store & Load JSON Tutorial: • Flutter Tutorial - Sha...
    Persist JSON Data Tutorial: • Flutter Tutorial - Log...
    Build Chat App Tutorial: • Flutter Tutorial - Bui...
    Google SignIn Tutorial: • Flutter Tutorial - Goo...
    Email SignIn Tutorial: • Flutter Tutorial - Ema...
    Share Texts, Images & Files Tutorial: • Flutter Tutorial - Sha...
    TIMELINE
    0:00 Introduction AutoComplete TextField
    0:46 Typeahead TextField
    1:34 Load Suggestions
    5:03 Display Suggestions UI
    7:15 Create Search TextField
    8:08 Search Debouncing
    9:24 Load Local Suggestions
    11:49 Display Local Suggestions
    12:48 Navigate To Detail Page
    SHARE | SUBSCRIBE | LIKE FOR MORE VIDEOS LIKE THIS
    *********
    SOCIAL MEDIA: Follow Us :-)
    Twitter | / heyflutter_
    Linkedin | / heyflutter
    LEARN MORE
    SOURCE CODE | github.com/JohannesMilke
    ARTICLES | / johannesmilke
    PLAYLISTS
    All Flutter Videos | • Flutter Tutorial - Flu...
    Widgets - Flutter | • Flutter Tutorial - Flu...
    Plugins - Flutter | • Flutter Tutorial - Flu...
    Animations - Flutter | • Flutter Tutorial - Tra...
    Designs - Flutter | • Flutter Tutorial - Flu...
    Firebase - Flutter | • Flutter Tutorial - Pag...
    State Management - Flutter | • Flutter Tutorial - Riv...
    CREDITS
    Copyright song "Corporate Technology" by scottholmesmusic.com
    #Flutter #Tutorial #JohannesMilke
    LIKE & SHARE & ACTIVATE THE BELL
    Thanks For Watching :-)
    bit.ly/JohannesMilke
  • Наука та технологія

КОМЕНТАРІ • 82

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

    This might help you :)
    👉 12 Week Flutter Training from Newbie to Expert: heyflutter.com
    Source Code: github.com/JohannesMilke/typeahead_example

  • @Hi-tk4he
    @Hi-tk4he 3 роки тому

    Wow! I was waiting for your video and it's really good.

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

    Johannes, You are awesome. Thank you very much for all your helpful videos !

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

    Brilliant and very helpful "as always" , keep going on

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

    thanks ur code saved life

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

    Amazing tutorial man!

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

    Thank you Johannes for the streighforward and informative explanation. Not only did I learn about Autocomplete package, I learnt about the Faker package! I bet it would go great with pagination_view 😎
    Excellent work and code, thank you for sharing! 🤩🥳

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

      Hi, I am trying to get paginated suggestions with the Autocomplete package , Have tried it with pagination_view? Does it work properly? Thanks.

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

    Good one, loved it.

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

    Amazing!
    Thank you man

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

    really helpful!

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

    Thanks for the tutorial bro

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

    You got +1 Subscriber ❤

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

    You man doing great!!!

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

      Thank you, Naveed Kaimkhami! 🙂

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

    Many thanks for this tutorial. I wish I knew how to incorporate this in a website.

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

    Man you're awesome, Thanks

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

    Thanks a lot, it helped me in project

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

    lmao, I searched for "username suggestion" all day long, then I tried changing it to "suggested username". Guess what, I've got a great video here, keep it up Johannes.

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

    THANK YOU SOOOOOOOOOOOOOOO MUCH

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

    Do you read my thoughts 😂 ) that's exactly what I looking for 🔥👍

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

    Excellent 😎..

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

    Thank you so much Mike. I want you to do a video on how to integrate algolia in flutter and dart

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

    You are greate

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

    Great tutorial Johannes! Thank you! Can this plugin also be used to autocomplete from a firebase database?

  • @Ravigupta-tu8rr
    @Ravigupta-tu8rr 2 роки тому

    Thank you Johannes for your all videos as all's videos are amazing.
    This video is also amazing but please make a video with auto complete google places.
    I hope you will make video and I will wait for your response on it.
    Thank you.

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

    Thanks a lot,

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

    How can I handle querying the text entered by user in first_name, last_name & user_name altogether? I'd like to search after the user types @, so the logic can work in chat applications, when I want to tag users. Thanks!

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

    Your content is stellar. Just curious, any way you can add secton headers for sorting? Let's say I want to order the suggestions and display
    A
    ---
    Alex
    Abby
    B
    ---
    Bob
    Ben
    I know this is supported out of the box in React with Material components, but I'm not convinced with Flutter.

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

    Awesome tutorial I was just thinking about it, Johannes can you please make a new tutorial for push notifications using firebase cloud functions and cloud messaging, your old tutorial uses some functions which have been deprecated. and the documentation on flutter fire site is just plain horrible.
    Thanks for saving our careers.

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

    As always brilliant ... would you make a signup, login emaillink firebase

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

    hello Johannes. i'm use TypeAhead and working normal when I input manual from keyboard , but when try scan value from barcode scanner its not working (value scanner not display on textfield and out focus). please help me

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

    I have a problem when using this package for flutter web in mobile view, when i tapped the textfield the keyboard showed and got dismissed, do you know what can cause this problem?

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

    Very instructive video, thanks. I was wondering, is it possible to actually update the pattern with the suggestion clicked by the user? I have been trying that out with no luck

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

      @@HeyFlutter I actually found a way using the controller in the textFieldConfiguration. And it is working like a charm :)

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

    Hi johannes thanks u. I struggle on trying to hide suggestions by pressing an arrow back iconbutton with prefixIcon textfield property but want to maintain the hidesuggestiononkeyboardhide : false . I tried suggestionboxcontroller.close(); when pressing prefixIcon but nothing happened. I you can help me on this please 🙏 😥

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

      Thank You Alioune Sakho! Follow this link: stackoverflow.com/questions/62572312/flutter-typeahead-suggestionbox-doesnt-hide
      I hope you will get your answer 🙂

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

    hello sir and really thank you for everything you do!!.. I am currently working on a form and I would like after a period of time to automatically send the user's information without having to click on a button, would you have an idea or a course that I could consult?? please!! thank you and have a good day

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

      Thank You eric tiobo! Follow this link: stackoverflow.com/questions/65191777/in-flutter-how-to-automate-button-without-clicking-after-a-period-of-time
      I hope you will get your answer 🙂

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

    Hola, Does it work on web too ?

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

    how can i show the suggestion box above the textfield ?

  • @Emir-nn1xc
    @Emir-nn1xc Рік тому

    I am using the flutter_typeahead package. When I use this package to search for something, it shows me some results related to what I searched for. However, when using this package on physical devices, the last option that appears is not being clicked. For example, if I search for "A", the results that appear are "A", "AA", "AAA", but when I try to click on "AAA" on my physical device, it is not being clicked, but it can be clicked on the emulator. Also, even when there is only one result, the problem of not being able to click on the last content still occurs.

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

      Hey, @user-rv8bi1yk7b 🙂 please go ahead and file your issue here: github.com/AbdulRahmanAlHamali/flutter_typeahead/issues

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

    Nice video. Although you're going very fast at it. These kind of video require explanation. Great work keep it up.

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

    Great! I want to do the same with photon.komoot.io/ . The API is there what changes do I need to make any idea ? I don't know how to use the api.

  • @bestmindcoolingrelaxationm1084

    Hello brother please help me to query data from mysql table based on substring input by a user for example if he type 'joh' and in the table we have ''johannes mike'' it should retrieve that row only.

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

      Thank You Best mind cooling & relaxation music! Follow this link: stackoverflow.com/questions/66645238/flutter-get-mysql-database-value
      I hope you will get your answer 🙂

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

    In flutter, how to create caption box like instagram (include #hashtags search function + normal textfeild)

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

    Great video!!!
    It is possible to do something like:
    Suggestions:
    ...
    List of suggestions here
    ...
    I'm trying, but because its itemBuilder, the "Suggestions:" also enter in the loop

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

      Thank you, Daniel Oliveira! 🙂. Try to proovide enough detail with your question whenever you have any question.

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

      @@HeyFlutter
      Sorry.
      I'm have to do a OpenSearch that the box widget with de the infos has something like that:
      TOP SUGGESTIONS:
      ***here the callback return with the top suggestions list that come from the API***
      SUGGESTIONS:
      **here the callback return with the suggestions list that come from the API**
      But, the TypeAhead use itemBuilder to build the corresponding Widget. There anyway to do something like the example above ?
      English is not my first language, I'm sorry

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

    Fun lesson! I found a slighty different way to setup device orientations in main function of main.dart:
    Future main() async {
    WidgetsFlutterBinding.ensureInitialized();
    await SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown
    ]).then((_) => runApp(MyApp())); //await setup before runApp...
    }

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

    Hey Milke, its a great video i was looking for. But how can we handle it if the data is coming from firebase firestore.

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

      @@HeyFlutter Thank you so much :) It was really helpful.

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

    I have noticed in the BottomNavigationBarItem that the title parm is deprecated and uses a String instead of a Text widget...
    class _MainPageState extends State {
    int index = 0;
    @override
    Widget build(BuildContext context) => Scaffold(
    bottomNavigationBar: _buildBottomBar(),
    body: _buildPages(),
    );
    Widget _buildBottomBar() => BottomNavigationBar(
    backgroundColor: Theme.of(context).primaryColor,
    // See bottomNavigationBarTheme in MyApp
    // theme: ThemeData(
    // primarySwatch: Colors.pink,
    // bottomNavigationBarTheme: const BottomNavigationBarThemeData(
    // selectedItemColor: Colors.white,
    // unselectedItemColor: Colors.white70,
    // ),
    // ),
    // selectedItemColor: Colors.white,
    // unselectedItemColor: Colors.white70,
    currentIndex: index,
    items: [
    BottomNavigationBarItem(
    icon: _buildTextIcon(),
    label: 'Network', // title parm is deprecated now uses label parm
    ),
    BottomNavigationBarItem(
    icon: _buildTextIcon(),
    label: 'Local',
    ),
    ],
    onTap: (int index) => setState(() => this.index = index),
    );
    Widget _buildTextIcon({String text = 'TypeAhead'}) =>
    Text(text, style: const TextStyle(color: Colors.white));
    ...

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

    Awsom

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

    Can you give a video for playstore subscription , there is no video on youtube about it

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

    Only first time when opening app or after installing it is working and 2nd time it' is not showing list is there where to apply set state or anything plz help me

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

      Thank You Manisha Dharmik! Follow this link: stackoverflow.com/questions/59848513/autocomplete-not-working-correctly-in-android-studio-with-flutter-first-sugges
      I hope you will get your answer 🙂

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

    Hey Johannes, nice one but I have a little question.
    The difference from this tutorial and this: ua-cam.com/video/oFZIwBudIj0/v-deo.html
    From what I could understand, both do the same filter feature, but using TypeAheadField you get more tools like empty list, debounce, etc and if you do not use TypeAheadField you will need to implement all these things manually, Am I right?

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

    not working my sdk is 2.7.0 do i really need to upgrade to 2.12? i got so many errors when i try updating my sdk

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

    what if the user inputs something that isn't in the autocomplete suggestions?

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

    Please add on ur idea list : login and signup with using Firestore and also fetch that data and show on textfield as a initial value to update later.

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

      @@HeyFlutter thanks hope i learn something new.

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

    tooppp

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

      Thanks, Antônio Guilherme! 🙂

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

    Flutter has itself Autocomplete widget. Can you make a video about it?

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

      Thanks for the idea, Nhật Lê Vũ Minh! 🙂 I have added it to my list of ideas for future videos!

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

    bro, can you help me ?
    how to show the loading progress everytime the user is typing ? i want user to know if they're typing the app send request to server .
    edited :
    i just found out how to do this haha.
    keepSuggestionsOnLoading: false
    great tutorial broo . thanks btw

  • @001Debjeet
    @001Debjeet Рік тому

    typeahead still doesnot support web :(

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

      Thanks for your feedback, Debjeet Debnath! 🙂

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

    I got one error : Error:XMLHttpRequest error.

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

    It's a missed opportunity that you didn't explain that the "TypeAhead" package is misnamed. You're talking properly about Autocomplete (provide possible additional characters based on a search space to permit abbreviations for common input text). Typeahead is a system that accepts characters from the keyboard ahead of them being able to be processed, and is such a natural flow these days that it's not seen as something that even needs a name, but clearly "TypeAhead" is nothing like "Autocomplete".

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

      @@HeyFlutter Actually, it seems pretty easy to imeplement the same thing with Flutter Autocomplete - you have textEditingController so you can hook to changes, then make a request and update a state variable for the results.