Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: improvement HTTP status for better clarity and consistency and fix updated url package #2

Merged
merged 6 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [2.0.1] - 2024-02-10

- **Enhanced comparability:** `operator ==` now uses `covariant` for better type safety and comparison accuracy.
- **Richer object representation:** `toString()` includes code, name, and description for easier debugging.

## [2.0.0] - 2024-02-06

### Added
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Constants enumerating the HTTP status codes in Dart. All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported.

[![Star this Repo](https://img.shields.io/github/stars/andgar2010/http_status.svg?style=flat)](https://github.com/andgar2010/http_status)
[![Star this Repo](https://img.shields.io/github/stars/DartForge/http_status.svg?style=flat)](https://github.com/DartForge/http_status)
<!-- [![Pub Package](https://img.shields.io/pub/v/http_status.svg?style=flat)](https://pub.dartlang.org/packages/http_status) -->
[![build status](https://github.com/andgar2010/http_status/actions/workflows/build.yml/badge.svg)](https://github.com/andgar2010/http_status/actions/workflows/build.yml)
[![build status](https://github.com/DartForge/http_status/actions/workflows/build.yml/badge.svg)](https://github.com/DartForge/http_status/actions/workflows/build.yml)

[![Coverage Status](https://coveralls.io/repos/github/andgar2010/http_status/badge.svg?branch=main)](https://coveralls.io/github/andgar2010/http_status?branch=main)
[![Coverage Status](https://coveralls.io/repos/github/DartForge/http_status/badge.svg?branch=main)](https://coveralls.io/github/DartForge/http_status?branch=main)

[![wakatime](https://wakatime.com/badge/user/7267c60f-69d6-47f2-941f-06869f08edc8/project/018d207e-c2bf-4b0f-96f5-77f9647157f8.svg)](https://wakatime.com/badge/user/7267c60f-69d6-47f2-941f-06869f08edc8/project/018d207e-c2bf-4b0f-96f5-77f9647157f8)

Expand All @@ -30,7 +30,7 @@ Constants enumerating the HTTP status codes in Dart. All status codes defined in
| 226 | I'M Used | IM_Used / IM_USED | imUsed |
| 300 | Multiple Choices | Multiple_Choices / MULTIPLE_CHOICES | multipleChoices |
| 301 | Moved Permanently | Moved_Permanently / MOVED_PERMANENTLY | movedPermanently |
| 302 | Found / Moved Temporarily | Found / Moved_Temporarily / FOUND / MOVED_TEMPORARILY | found / movedTemporarily |
| 302 | Found / Moved Temporarily | Found / Moved_Temporarily / FOUND / MOVED_TEMPORARILY | found / movedTemporarily |
| 303 | See Other | See_Other / SEE_OTHER | seeOther |
| 304 | Not Modified | Not_Modified / NOT_MODIFIED | notModified |
| 305 | Use Proxy | Use_Proxy / USE_PROXY | useProxy |
Expand Down Expand Up @@ -206,7 +206,7 @@ if (res.statusCode.isSuccessfulHttpStatusCode) {

## Thanking all Awesome Contributors :heart:

[![Contributors](https://contrib.rocks/image?repo=andgar2010/http_status)](https://github.com/andgar2010/http_status/graphs/contributors)
[![Contributors](https://contrib.rocks/image?repo=DartForge/http_status)](https://github.com/DartForge/http_status/graphs/contributors)

Contributions of any kind are welcome!

Expand All @@ -218,4 +218,4 @@ Contributions of any kind are welcome!

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]: https://github.com/andgar2010/http_status/issues
[tracker]: https://github.com/DartForge/http_status/issues
14 changes: 9 additions & 5 deletions lib/src/http_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3162,12 +3162,16 @@ class HttpStatus {
int get hashCode => code.hashCode;

@override
bool operator ==(Object other) =>
bool operator ==(covariant HttpStatus other) =>
identical(this, other) ||
other is HttpStatus &&
runtimeType == other.runtimeType &&
code == other.code;
runtimeType == other.runtimeType && code == other.code;

@override
String toString() => 'HttpStatus{code: $code, name: $name}';
String toString() => '''
HttpStatus(
code: $code,
name: '$name',
description: '$description'
)
''';
}
2 changes: 1 addition & 1 deletion lib/src/src.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export 'http_status.dart';
export 'http_status_code.dart';
export 'utils/int_extension.dart';
export 'utils/int_http_status_code_extension.dart';
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: http_status
description: Constants enumerating the HTTP status codes in Dart. All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported.
version: 2.0.0
repository: https://github.com/andgar2010/http_status
issue_tracker: https://github.com/andgar2010/http_status/issues
homepage: https://github.com/andgar2010/http_status
documentation: https://github.com/andgar2010/http_status
version: 2.0.1
repository: https://github.com/DartForge/http_status
issue_tracker: https://github.com/DartForge/http_status/issues
homepage: https://github.com/DartForge/http_status
documentation: https://github.com/DartForge/http_status
topics: [http_status]
# author:
# - Andrea Cantafio <kk4r.1m@gmail.com>
Expand Down
Loading