how can add a drop down button ro my sign up page...?

142 Views Asked by At

i want to add a gender drop down to my sign-up page in flutter Android studio, how do i do it my sign-up page

i want to add a gender drop down to my sign-up page, it's in sign-up page and it is a login, sign up, dashboard project it done in Android studio using flutter

1

There are 1 best solutions below

3
Abdullatif Eida On

My brother share cleaner question by adding: 1- your code 2- clean screen shoot of wanted page

but I will share widget code of gender dropdown

 Padding(
   padding: EdgeInsets.only(
                                    top:
                                        MediaQuery.of(context).size.height *
                                            0.01),
                                child: Container(
                                  decoration: BoxDecoration(
                                    color: const Color(0xFFEEEEEE),
                                    border: Border.all(
                                        color: const Color(0xFFEEEEEE)),
                                    borderRadius: BorderRadius.circular(7),
                                  ),
                                  child: DropdownButton(
                                    hint: Padding(
                                      padding: const EdgeInsets.all(10.0),
                                      child: Text(
                                       "click to choose",
                                        style: const TextStyle(
                                            fontSize: 14,
                                            color: Colors.black,
                                            ),
                                      ),
                                    ),
                                    underline: const SizedBox(),
                                    style: const TextStyle(
                                        fontSize: 14,
                                        color: Colors.black,
                                        ),
                                    icon: const Padding(
                                      padding: EdgeInsets.all(
                                        13,
                                      ),
                                      child: Icon(Icons.arrow_drop_down,
                                          size: 18, color: Colors.grey),
                                    ),
                                    isExpanded: true,
                                    items: [
                                     "male"
                                      "female",
                                    ].map(
                                      (val) {
                                        return DropdownMenuItem<String>(
                                          value: val,
                                          child: Text(val!),
                                        );
                                      },
                                    ).toList(),
                                    onChanged: (val) {
                                      setState(() {
                                        yourVar =
                                            val.toString();
                                      });
                                    },
                                  ),
                                ),
                              ),