Search code examples
flutterdartdropdown

error GBF4691A2: No named parameter with the name 'Icons'


Hey guys i'm trying to run my code but i'm getting an error said " error GBF4691A2: No named parameter with the name 'icon'.'"

This is my code: Try so many way to do but still get the error from that please help me

 .map((item) => DropdownMenuItem<String>(
                                            value: item,
                                            child: Text(
                                              item,
                                              style: const TextStyle(
                                                fontSize: 14,
                                                fontWeight: FontWeight.bold,
                                                color: Colors.black,
                                              ),
                                              overflow: TextOverflow.ellipsis,
                                            ),
                                          ))
                                      .toList(),
                                  value: selectedIssue,
                                  onChanged: (value) {
                                    setState(() {
                                      selectedIssue = value as String;
                                    });
                                  },
                                  icon: const Icon(
                                    Icons.arrow_forward_ios_outlined,
                                  ),

Is anyone can help me to fix it?


Solution

  • DropdownMenuItem does not have a parameter called Icons, but it has icon.

    You misspelled it somehow.

    Simply change Icons: const Icon() to icon: const Icon()