isInvalid function
Returns a Matcher that matches an Invalid value.
If matcher is provided, the matched error inside Invalid must also
satisfy it. If omitted, any Invalid value matches.
Implementation
Matcher isInvalid([Object? expected]) => _IsInvalid(expected);