Skip to content

DropdownButtonFormField changes not absorbing Form onChanged Function #86336

@TheSlateAndChalk

Description

@TheSlateAndChalk

I tried to get Form field if any changes happen then run few operations. But, DropdownButtonFormField changes not listen Form onchanged funciton.

Form(
onChanged: () {
print('change Happned');
},
key: _formKey,
child: DropdownButtonFormField<String>(
                        isExpanded: true,
                        decoration: InputDecoration(
                            labelText: 'Label',
                            isDense: true,
                            contentPadding:
                                EdgeInsets.symmetric(
                                    vertical: 6.0)),
                        value: _emailAddressLabelValue,
                        focusNode: _emailAddressLabelNode,
                        hint: Text('Label'),
                        items: <String>[
                          'Home',
                          'Work',
                          'Other'
                        ]
                            .map((label) => DropdownMenuItem(
                                  child: Text(
                                    label,
                                    overflow:
                                        TextOverflow.ellipsis,
                                  ),
                                  value: label,
                                ))
                            .toList(),
                        onChanged: (value) {
                                setState(() {
                                  _emailAddressLabelValue =
                                      value!;
                                });
                              },
                      )
)

Metadata

Metadata

Assignees

Labels

f: material designflutter/packages/flutter/material repository.found in release: 2.2Found to occur in 2.2found in release: 2.4Found to occur in 2.4frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions