Flutter streams/controllers naming convention

Viewed 72

I have a question about the naming convention of exposed Streams and private StreamControllers in your apps. Currently, we have sth like that:

final BehaviorSubject<T> _valueController;
ValueStream<T> get valueStream => _valueController;
Stream<void> get errorStream => _errorController;
final PublishSubject<T> _errorController;

And of course, adding all the time Suffixes like "Stream" or "Controller" is a kinda boilerplate. There are some concepts on how to change it based on web development solutions like:

Future<String> getName(){}

Stream<String> watchName() {}

Future<String> name() {}

Stream<String> name$() {}

But I'm wondering what is the most popular/best solution in Flutter? Do you have this problem in your projects?

0 Answers
Related