If this Option is a Some and calling f returns true, then return this Some. Otherwise return None.
f
true
@override Option<T> filter(bool Function(T t) f) => flatMap((t) => f(t) ? this : const Option.none());