Implementation of Drop-Down List in Flutter

Geno Tech
App Dev Community
Published in
2 min readFeb 8, 2021

--

knowledge sharing in Flutter #8

This is another step of our Flutter journey. The purpose of this series of the story is solving your small implementation problems with mobile development. Flutter is the most emerging cross-platform framework nowadays. In this story, I will show you how to implement a drop-down menu list. It’s simple. Cool !!!

First, you need to create a new project. We are going to edit the main. dart file only. So you no need to create any other file rather main.dart file is created initially.

Image: Creating the new project

In this main. dart file, have the MyApp, StatelessWidget and it has called to MyHomePage, StatefulWidget. There have implemented the _MyHomePageState as the first state. Inside this state, We are going to implement the drop-down list. Nice !!!

Let’s create a DropdownButton widget. Then, implement the properties and onChange event. Item List is building as a list inside of the DropdownButton. That’s all about the implementations. I will show you the complete code snippet below.

import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
//

--

--

Geno Tech
App Dev Community

Software Development | Data Science | AI — We write rich & meaningful content on development, technology, digital transformation & life lessons.