initListener method

void initListener(
  1. Function afterClear
)

Implementation

void initListener(Function afterClear) async {
  AppHolder.eventBus.on<MyRoundedSearchInputClearEvent>().listen((event) {
    if (event.key == this.key) {
      _controller?.text = '';
      _controller?.clear();
      afterClear();
    }
  });
}