"eventemitter is deprecated and shouldn't be used" Code Answer

5

just use a normal streamcontroller

final _onnamechangecontroller = new streamcontroller<string>.broadcast();
@output()
stream<string> get onnamechange => _onnamechangecontroller.stream;

.broadcast is optional. it is required to allow multiple subscribers.

see also https://www.dartlang.org/articles/libraries/broadcast-streams

By Daniel Manta on July 26 2022

Answers related to “eventemitter is deprecated and shouldn't be used”

Only authorized users can answer the Search term. Please sign in first, or register a free account.