Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormBuilderDropdown is not displayed correctly, when readOnly is equal to true #154

Closed
hsinte opened this issue Oct 21, 2019 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@hsinte
Copy link

hsinte commented Oct 21, 2019

Everything is fine,when readOnly is Not set to true.

When readOnly is set to true, the value is displayed instead of child.

For example, when readOnly=true, initialValue='1',

I expect to show "apple" but actually show "1".

Map labelValue = Map();
labelValue['apple'] = '1';
labelValue['banana'] = '2';

var fbd = FormBuilderDropdown(
      attribute: 'test',
      initialValue: '1',
      decoration: InputDecoration(
        labelText: 'test',
      ),
      items: labelValue.entries.map((item) {
        return DropdownMenuItem(
          value: item.value,
          child: Text(item.key),
        );
      }).toList(),
      //readOnly: true,
    );

return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('test'),
        ),
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Center(
            child: fbd,
          ),
        ),
      ),
    );
@danvick danvick added the bug Something isn't working label Oct 22, 2019
@danvick danvick closed this as completed in 9fb15c7 Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants