Try this
DropdownButton<String>(
items: <String>['A', 'B', 'C', 'D'].map((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
onChanged: (_) {},
)
More Related Contents:
- Flutter: There should be exactly one item with [DropdownButton]’s value
- Is there a difference in how member variables are initialized in Dart?
- Flutter: How to correctly use an Inherited Widget?
- Flutter: RenderBox was not laid out
- What are Keys in the Stateless widgets class?
- How to upload images and file to a server in Flutter?
- Flutter- wrapping text [duplicate]
- How to implement Dark mode and Light Mode in flutter?
- Flutter Countdown Timer
- How to change the application launcher icon on Flutter?
- ListView does not refresh whereas attached list does (Flutter)
- Textfield validation in Flutter
- Flutter Build Error: Process ‘command ‘E:\Flutter Apps\flutter\bin\flutter.bat” finished with non-zero exit value 1
- how to place a listview inside a SingleChildScrollView but prevent them from scrolling separately?
- How to convert Flutter color to string and back to a color
- TextField inside of Row causes layout exception: Unable to calculate size
- How to make an AlertDialog in Flutter?
- Vertical viewport was given unbounded height
- Error thrown on navigator pop until : “!_debugLocked’: is not true.”
- Flutter: Ignore touch events on a Widget
- HTTP POST with Json on Body – Flutter/Dart
- Flutter: “RenderFlex children have non-zero flex but incoming height constraints are unbounded”
- How to make a full screen dialog in flutter?
- Query a single document from Firestore in Flutter (cloud_firestore Plugin)
- How to create a dynamic TabBarView/ Render a new Tab with a function in Flutter?
- Flutter: Execution failed for task ‘:app:compileDebugKotlin’
- How can I simulate a tap event on a Flutter widget?
- How do you get the document id after adding document in Cloud Firestore in Dart
- How to call a named constructor from a generic function in Dart/Flutter
- How to log data to the Flutter console?