Closed sath26 closed 2 years ago
class SearchInput extends StatelessWidget {
@override
Widget build(_) {
return BlocBuilder<SearchQueryBloc, String>(
builder: (context, state) {
return Flexible(
child: TextField(
decoration: const InputDecoration(
icon: Icon(Icons.search),
labelText: 'Search',
),
textInputAction: TextInputAction.search,
onChanged: (value) =>
context.bloc<SearchQueryBloc>().add(SetSearchQuery(value)),
),
);
},
);
}
}
the example doesnt have change in searchinput
function from searchquerycubit
to searchquerybloc
. it is so because the flutter package thats get pulled doesnt have searchquerycubit
. instead searchquerybloc
has been used.
above is the code to make the necessary change in onChanged
attribute.
As of https://github.com/danahartweg/flutter_bloc_list_manager/releases/tag/v0.3.1
both the package implementation and documentation should completely reference SearchQueryCubit
instead of SearchQueryBloc
. Which I don't think is really what you're seeing, but I wanted to mention it.
Not being able to find the correct provider will usually mean that there isn't a ListManager
in the tree above the SearchInput
you're trying to render.
I know this was submitted a long time ago (apologies for the delay), but are you still having issues?
nope.. no more issues.. thank you for the reponse but most importantly thank u for the update of the package...
Awesome! Glad it's all sorted.
no any modifiction to code but couldnt figure out how to solve this