这应该做您想要的:
expect(() => operations.lookupOrderDetails(), throwsA(const TypeMatcher<MyCustErr>()));expect(() => operations.lookupOrderDetails(), isInstanceOf<MyCustErr>());

这应该做您想要的:
expect(() => operations.lookupOrderDetails(), throwsA(const TypeMatcher<MyCustErr>()));expect(() => operations.lookupOrderDetails(), isInstanceOf<MyCustErr>());