How to Remove Underline From DropDownButtonForm Field In Flutter ?
DropDown List is used only we have to select only one item from the list of available items so in this article we will go through How To Remove Underline From DropDownButtonForm Field In Flutter
So let’s Dive into the same.
Take a look at the below image to understand it very clearly.
How to Remove Underline From DropDownButton Form Field In Flutter?
Follow Steps like below:
Change Decoration: InputDecoration to decoration: InputDecoration.collapsed
body: SizedBox( width: 100.0, child: DropdownButtonFormField<int>( decoration: InputDecoration.collapsed(hintText: ''), value: 2, ...
User can also use enabledBorder: UnderlineInputBorder
DropdownButtonFormField<int>( decoration: InputDecoration( enabledBorder: UnderlineInputBorder( borderSide: BorderSide(color: Colors.white))), value: 2, items: <DropdownMenuItem<int>>[ ....
So The User can also wrap a DropDownButton Inside DropDownButtonHideUnderline like below:
new DropdownButtonHideUnderline( child: DropdownButton() )
Setting the underline property to SizedBox() makes it invisible too:
DropdownButton( underline: SizedBox(), ... )
Users can also set Input. Border to none using below code snippet.
DropdownButtonFormField<int>( decoration: InputDecoration( enabledBorder: InputBorder.none, ... ), ... )
Thanks for Reading and on a Flutter Journey !!!
Kindly do let us know your thoughts on an Article.
Keep Learning!!! Keep Fluttering!!! If you are confused about something in flutter!!
Do let us know, we would love to assist 🙂
So in this article, We Have Been through How to Remove Underline From DropDownButtonForm Field In Flutter.
FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc.