25 lines
521 B
Dart
25 lines
521 B
Dart
import 'dart:async';
|
|
|
|
final appBloc = AppPropertiesBloc();
|
|
|
|
class AppPropertiesBloc {
|
|
StreamController<String> _title = StreamController<String>();
|
|
StreamController<bool> _editable = StreamController<bool>();
|
|
|
|
Stream<String> get titleStream => _title.stream;
|
|
Stream<bool> get editable => _editable.stream;
|
|
|
|
updateTitle(String newTitle) {
|
|
_title.sink.add(newTitle);
|
|
}
|
|
|
|
toggleEditable(bool editable) {
|
|
_editable.sink.add(!editable);
|
|
}
|
|
|
|
dispose() {
|
|
_title.close();
|
|
_editable.close();
|
|
}
|
|
}
|