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

FormBuilderCustomField as dropdownbutton and FormBuilderDropdown UI problem #63

Closed
shariful2011 opened this issue May 22, 2019 · 3 comments

Comments

@shariful2011
Copy link

From this image http://prntscr.com/nrrkpw you can understand what I am talking about. It looks really odd. Is there a way to solve this issue?

@danvick
Copy link
Collaborator

danvick commented May 23, 2019

Kindly stick with FormBuilderDropdown

Column(
  children: <Widget>[
    FormBuilderDropdown(
      attribute: "country",
      hint: Text('Select Country'),
      onChanged: (val) {
        //Clear any selected fields for governorate and district if country changes
        _fbKey.currentState.fields['governorate'].currentState
            .didChange(null);
        _fbKey.currentState.fields['district'].currentState
            .didChange(null);
        //TODO: Update Governorates list
      },
      decoration: InputDecoration(
        labelText: 'Country',
        labelStyle: TextStyle(
          fontFamily: 'Open Sans',
        ),
      ),
      validators: [
        FormBuilderValidators.required(
            errorText: 'Please select District.'),
      ],
      initialValue: null,
      items: countries,
    ),
    FormBuilderDropdown(
      attribute: "governorate",
      hint: Text('Select governorate'),
      onChanged: (val) {
        //Clear any selected fields for district if governorate changes
        _fbKey.currentState.fields['district'].currentState
            .didChange(null);
        //TODO: Update Districts list
      },
      decoration: InputDecoration(
        labelText: 'Governorate',
        labelStyle: TextStyle(
          fontFamily: 'Open Sans',
        ),
      ),
      validators: [
        FormBuilderValidators.required(
            errorText: 'Please select governorate.'),
      ],
      initialValue: null,
      items: governorates,
    ),
    FormBuilderDropdown(
      attribute: "d",
      hint: Text('Select governorate'),
      onChanged: (val) {
        _fbKey.currentState.fields['district'].currentState
            .didChange(null);
        
      },
      decoration: InputDecoration(
        labelText: 'District',
        labelStyle: TextStyle(
          fontFamily: 'Open Sans',
        ),
      ),
      validators: [
        FormBuilderValidators.required(
            errorText: 'Please select district.'),
      ],
      initialValue: null,
      items: districts,
    ),
  ],
),

@danvick danvick closed this as completed May 23, 2019
@shariful2011
Copy link
Author

Thanks this solved my all problems including the null exception.

@danvick
Copy link
Collaborator

danvick commented May 23, 2019

Glad to hear that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants