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

FormBuilderCheckboxList error onTap : UnmodifiableListBase.add #112

Closed
dzluppin opened this issue Aug 13, 2019 · 2 comments
Closed

FormBuilderCheckboxList error onTap : UnmodifiableListBase.add #112

dzluppin opened this issue Aug 13, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@dzluppin
Copy link

Hey, this plugin is actually a life saver. But I have a problem when using FormBuilderCheckboxList inside FutureBuilder. All checkbox not work when clicked.

Here's my code :

FutureBuilder(
builder: (BuildContext context, AsyncSnapshot<List> snapshot) {
if (snapshot.hasData) {
return FormBuilderCheckboxList(
attribute: 'artCategory',
leadingInput: true,
options: snapshot.data
.where((test) => test.tipe)
.map((dt) => FormBuilderFieldOption(value: dt.id.id, label: dt.title))
.toList(),
);
} else if (snapshot.hasError) {
return Center(
child: Text(snapshot.error),
);
}
return Center(
child: ListTile(
leading: CircularProgressIndicator(),
title: Text('Loading Category...'),
),
);
},
future: _bloc.categoryByARTType(widget.form.tipe, widget.form.objectObserv),
)

Then, when i click some checkbox, flutter throw this error :

flutter: Unsupported operation: Cannot add to an unmodifiable list flutter: Handler: "onTap" Recognizer: TapGestureRecognizer#3f16e flutter: #0 UnmodifiableListBase.add (dart:_internal/list.dart:114:5) #1 _FormBuilderCheckboxListState._checkbox.<anonymous closure> (package:flutter_form_builder/src/fields/form_builder_checkbox_list.dart:78:27)

  • ps : I don't know how to write code in issue submission so i used quote instead. Sorry.
@dzluppin dzluppin changed the title FormBuilderCheckboxList FormBuilderCheckboxList error onTap Aug 13, 2019
@dzluppin dzluppin changed the title FormBuilderCheckboxList error onTap FormBuilderCheckboxList error onTap : UnmodifiableListBase.add Aug 13, 2019
@danvick
Copy link
Collaborator

danvick commented Aug 21, 2019

Hi @dzluppin,
Thanks for making this known.
A fix is in the works and will be published in a few.

Your feedback is much appreciated.

@danvick danvick added the bug Something isn't working label Aug 21, 2019
@danvick
Copy link
Collaborator

danvick commented Aug 21, 2019

Kindly confirm that this bug has been addressed in v3.4.0.
Feel free to reopen this issue if not.

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