Solution: Implementing a Search Feature
Explore how to build a search feature in Flutter with the BLoC pattern. Understand emitting loading, loaded, and error states during asynchronous API calls. Learn to provide the SearchBloc to widgets and handle user input events, enhancing your app's state management skills.
We hope you did well in the previous exercise! It’s time to compare your solution to ours.
Implementing the search function
To implement the search function, we use the search feature of SWAPI API.
Line 2: We provide the category and the query to the request URL using
category.nameandqueryin the parameter.Line 4: We send the
get()request....