setBackend method
- dynamic next
Another build needs a worker of its own, so the loaded model goes and the next one is planned.
Implementation
void setBackend(BrowserTextBackend next) {
if (next == backend) return;
backend = next;
_engine?.dispose();
_engine = null;
state = BrowserModelState.unplanned;
plan = null;
errorCode = null;
errorMessage = null;
_notify();
unawaited(_plan());
}