fluffychat/lib/pangea/controllers/base_controller.dart
wcjord a1f9e6a243
Toolbar practice (#702)
* drafting toolbar with practice

* moved some code around

* turning overlay message content into text buttons for selection, updated toolbar buttons progress bar

* activities displaying and forwarding toolbar

* experimenting with using choice value rather than index for logic

* reimplementation of wordnet results and translation for individual words

* cache and timer

* mostly done with activities in toolbar flow

---------

Co-authored-by: ggurdin <ggurdin@gmail.com>
Co-authored-by: choreo development <williamjordan-cooley@Williams-MacBook-Pro-3.local>
2024-09-25 17:01:58 -04:00

18 lines
334 B
Dart

import 'dart:async';
class BaseController<T> {
final StreamController<T> stateListener = StreamController<T>();
late Stream<T> stateStream;
BaseController() {
stateStream = stateListener.stream.asBroadcastStream();
}
dispose() {
stateListener.close();
}
setState(T data) {
stateListener.add(data);
}
}