commit method
Commits widget to the terminal's history above the region: laid out
at the terminal's width, as tall as it is there, written by the next
frame. Completes once its rows are written; at once once the session
has ended.
Implementation
Future<void> commit(Widget widget) {
if (_ended) {
return Future.value();
}
final commit = _Commit(_commits.length, widget);
_commits.add(commit);
_pending.add(commit);
_changed();
return commit.written.future;
}