form_bloc icon indicating copy to clipboard operation
form_bloc copied to clipboard

use built_collection to expose field blocs in form bloc - list field - group - field states.

Open GiancarloCode opened this issue 4 years ago • 2 comments

By using built_collection we can prevent the user from making mutations to the collections of field blocs that use the blocs (form, list, and group), which would cause unexpected behaviors, such as validation errors.

GiancarloCode avatar Mar 26 '20 12:03 GiancarloCode

Hi @GiancarloCode where exactly do you plan to be using built_collection is it the abstract class FormBloc? It si also worth taking into account that built collection wont prevent the user to mutate the data of the items in the collection.

fabiancrx avatar Apr 03 '20 14:04 fabiancrx

@fabiancrx Hello :) For example in https://pub.dev/documentation/form_bloc/latest/form_bloc/ListFieldBlocState/fieldBlocs.html or https://pub.dev/documentation/form_bloc/latest/form_bloc/FormBlocState/fieldBlocs.html This will prevent from trying to change the order, or delete a field bloc "by error"

GiancarloCode avatar Apr 11 '20 04:04 GiancarloCode