3.6 DropDown Button in flutter - DropdownFormField Flutter 2023

Поділитися
Вставка
  • Опубліковано 26 чер 2022
  • In this flutter tutorial, we are going to learn how to create a dropdown button in flutter.
    PLAYLIST: • Flutter Crash Course f...
    We will create two types of dropdown button in flutter. Simple Dropdown flutter widget and 2nd dropdownformfield flutter material design widget 2022. We will use decoration in flutter dropdownformfield decoration property to set border and add material design to our dropdown button.
    SOURCE CODE
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    🧑‍💻 CODE & RESOURCES codingwitht.com/flutter-crash...
    ❤️ COURSES
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ► FLUTTER CRASH COURSE • Flutter Crash Course f...
    ► LOGIN APP with GETX • Flutter Login App - UI...
    ► E-COMMERCE APP • Professional Flutter E...
    ❤️ SUPPORT
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Like and Subscribe @CODINGwithT for more amazing content
    ► Subscribe ua-cam.com/users/Codingwithtea...
    FOLLOW @CodingwithT on SOCIAL MEDIA!
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    💻 Facebook: / codingwithtea
    💻 Instagram: / coding_with_tea
    #flutter_crash_course_2023 #coding_with_T #flutter_course_2023
  • Наука та технологія

КОМЕНТАРІ • 46

  • @wuba6977
    @wuba6977 Рік тому +2

    I literally watched different flutter tutorials and even enrolled on some courses, but your tutorial is the best I've watched. Thank you very much 💖

    • @CodingwithT
      @CodingwithT  Рік тому +2

      So nice of you 😊. I'm very glad that my content is helpful 🤠 🎉.
      Stay tuned for more. ✌️

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

    My man, THANK YOU VERY MUCH for this! You just helped me a lot!

  • @crazy-man
    @crazy-man Рік тому +2

    yes, useful. I remember once doing a drop down list half a year ago, I couldn’t form normally, it turns out dropdownbuttonformFild had to be used

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

    Great Tutorial !! Thanks

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

    Simply the best

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

    Thanks brother❤️
    this playlist is very informative. when will you teach us backend i'm waiting for that.

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

      You welcome 😁 🤠. I'm about to start an e-commerce app from scratch with a frontend backend DB

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

    informative

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

    How do I make the dropdown stay open until a user selects an item, instead of dismissing when they touch outside of it?

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

    great

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

    Very nice tutorial sir

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

      Thank you so much dear! ✌️😃

  • @Sujood-Eldda
    @Sujood-Eldda Рік тому +1

    May you please share your git URL for this project?

  • @user-kn2kx4jl3h
    @user-kn2kx4jl3h Рік тому

    Hi, Really love your tutorials, however I am having issues trying to refactor the dropdownbuttonformfield, so if you could kindly assist or anyone assist. Thanks

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

    How to give different background color to dropdownmenuitem? Like I want to give blue color to odd dropdownmenuitem and red color to even dropdownmenuitem.

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

      Hi Freiza Gen, have you solved your problem? 🤠

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

      Simply wrap the dropdown button with a Container and give it a background color.
      Cheers 🥂

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

    MashaAllah

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

    I'm having trouble getting past 4:26, where the value is added to the DropdownButton(). Everything is working fine and looking like your example up until that point, but once I create the constructor and add 'value: _selectedVal', after hot reloading I get a massive red error screen in my emulator with the following message,
    "The following assertion was thrown building MyForm(dirty, state: _MyFormState#36db4):
    There should be exactly one item with [DropdownButton]'s value: .
    Either zero or 2 or more [DropdownMenuItem]s were detected with the same value
    'package:flutter/src/material/dropdown.dart':
    dropdown.dart:1
    Failed assertion: line 888 pos 15: 'items == null || items.isEmpty || value == null ||
    items.where((DropdownMenuItem item) {
    return item.value == value;
    }).length == 1"
    I tried to delete all the code that I wrote and rewatch the video 3 times and I still am getting that error no matter what. Thanks for all these tutorials, they're very helpful and everything has been smooth sailing up until this point. Any help would be greatly appreciated.
    EDIT: I walked away from my computer out of frustration, came back and reloaded the code for the hundredth time and it randomly is working perfect and the red error screen is gone. I changed nothing, so I have no idea what was going on lol. Thanks again.

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

    how do you make dropdown button in flutter with string and int value at the same time?

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

      Simply create a list of any type of values

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

      Thank you, but can you show me an example? I'm new in flutter

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

    sir is there any reference if i use data from firebase?

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

      I have started a new playlist which you can get from my channel.
      In that I'll explain complete CRUD

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

    Form validation not working on this dropdownformfield

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

    when I input setState() it turns into an error how do i Fix this?

  • @usertuserb7057
    @usertuserb7057 Рік тому +3

    وعليكم السلام ورحمة الله وبركاته.
    جزاك الله خيرا.
    Big thanks from Agleria.
    please sir i follow your tutorial ,
    but i have a probleme to see my selected item.
    here it is my code:
    import 'package:flutter/material.dart';
    class Test extends StatefulWidget {
    @override
    State createState() => _TestState();
    }
    class _TestState extends State {
    @override
    Widget build(BuildContext context) {
    String selectedFruits = 'BN';
    return Scaffold(
    appBar: AppBar(),
    body: Center(
    child: DropdownButton(
    items: ["BN", "OR", "MD", "PO"]
    .map((e) => DropdownMenuItem(
    value: e,
    child: Text("$e"),
    ))
    .toList(),
    onChanged: (val) {
    print('$val');
    setState(() {
    selectedFruits = val as String;
    });
    },
    value: selectedFruits,
    ),
    ),
    );
    }
    }

    • @CodingwithT
      @CodingwithT  Рік тому +2

      Thank you so much 🥰, and sorry for the delay. You are still facing the issues?

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

      @@CodingwithT No,
      الحمد لله.
      بارك الله فيك.

    • @CodingwithT
      @CodingwithT  Рік тому +2

      Alhamdolillah

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

    Iits sad to see so small number of likes

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

      Nevermind I hope people like you will come ✌️😃

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

    please how can i get access to the source code