validating a controller form a TextForm to query and select the suggestion and put the suggestion y the field

8 Views Asked by At
return StreamBuilder<String>(
      stream: bloc.intitutionStream,
      builder: (context, snapshot) {
        return Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
          ´´´´´´´´´´
              child: TypeAheadField<DatoInstitucion>(
                /* suggestionsController: bloc.controllersugestInst, */
                controller: bloc.controllerInsitucion,

this helps to search and show a list of suggestion according from the field

` suggestionsCallback: (pattern) {
                  return Provider.of<InstiService>(context, listen: false)
                      .getInst(pattern);
                },`

but once i try to selectect the option

 onSelected: (DatoInstitucion suggestion) {
                  institucionSelect = suggestion;
                  setState(() {
                    bloc.changeInstitution(suggestion.nombreInstitucion);
                    /* bloc.lastInst = suggestion; */
                  });
                },

i need to change the controller and put the new suggestion in the field

i trying to manage the controller and change the value from the onChange and use the selected info to the new controller but its doesn´t work.

0

There are 0 best solutions below