filter property
Optional message filter function.
When provided, all messages pass through this filter before reaching the model's update method. The filter can:
- Return the message unchanged to allow it through
- Return a modified message
- Return
nullto filter out the message completely
Example:
final options = ProgramOptions(
filter: (model, msg) {
// Log all messages
print('Message: $msg');
return msg;
},
);
Implementation
final MessageFilter? filter;