GiancarloCode/form_bloc

addFieldBlocs and removeFieldBlocs issue

nawaf-na1807684 opened this issue · 1 comments

I'm using addFieldBlocs and removeFieldBlocs based on SelectFieldBloc changes. The problem is when I use declare:
static final EmployerLogo = InputFieldBloc<ElevatedButton?, dynamic>(
initialValue: null,
validators: [FieldBlocValidators.required],
);
and included in widget build in:
BlocBuilder<InputFieldBloc, InputFieldBlocState>(
bloc: ConditionalFieldsForm.EmployerLogo,
builder: (context, state) {
return ElevatedButton(
onPressed: () async {
logo = await ImagePickerServices
.getImageAsFile();
if (logo == null) return;

                                logoUrl = await FirebaseStorageServices
                                    .uploadToStorageAsHTMLFile(
                                        file: logo!,
                                        folderName: StorageFolderNames
                                            .employerFolder);

                                setState(() {});
                              },
                              child: Text('     Upload Employer Logo     '),
                            );
                          },
                        ),

the changes on SelectFieldBloc doesn't add or remove the button. it is stuck like in the next image:
image