failureWithCode function
Матчер: ошибка с ожидаемым стабильным кодом (Failure.code).
expect(failure, failureWithCode('http.unauthorized'));
Implementation
Matcher failureWithCode(String code) =>
isA<Failure>().having((f) => f.code, 'code', code);