emit was called after an event handler completed normally. This is usually due to an unawaited future in an event handler. Please make sure to await all asynchronous operations with event handlers and use emit.isDone after asynchronous operations before calling emit() to ensure the event handler has not completed. BAD on<Event>((event, emit) { future.whenComplete(() => emit(...)); }); GOOD on<Event>((event, emit) async { await future.whenComplete(() => emit(...)); }); )
Обсуждают сегодня