I'm beginner in flutter_bloc
pattern and i am trying to text search by using bloc
. The problem is when i use this code at below:
import 'package:rxdart/rxdart.dart';
import 'package:bloc/bloc.dart';
class SearchBloc extends Bloc<SearchEvent, SearchState> {
SearchRestaurantDataService searchRestaurantDataService;
@override
Stream<LoadedAllRestaurantState> transform(
Stream<LoadSearchRestaurantEvent> events,
Stream<LoadedAllRestaurantState> Function(LoadSearchRestaurantEvent event)
next) {
return super.transform( //Here getting error "The method 'transform' isn't defined in a superclass of 'SearchBloc'."
(events as PublishSubject<LoadSearchRestaurantEvent>)
.debounceTime(Duration(milliseconds: 1000)),
next);
}
}
Getting an error on transform and i know this code is outdated because this code before 1-2 years. Can someone provide updated code of this transform
error.