handleInitEvent method
Processes the initialization event. It fetches country metadata and triggers the initialized event.
Implementation
Stream<MatexCountryBlocState> handleInitEvent(String? jsonData) async* {
if (canInitialize) {
isInitializing = true;
yield MatexCountryBlocState(isInitializing: true);
_countryProvider = MatexCountryDataProvider(jsonData: jsonData);
final countries = await _countryProvider.list();
addEvent(MatexCountryBlocEvent.initialized(countries));
}
}