withFilter method
Creates options with the given message filter.
Example:
final options = ProgramOptions().withFilter((model, msg) {
if (msg is KeyMsg && msg.key.type == KeyType.ctrlC) {
if (model is MyModel && model.hasUnsavedChanges) {
return const ConfirmQuitMsg();
}
}
return msg;
});
Implementation
ProgramOptions withFilter(MessageFilter filter) => copyWith(filter: filter);