Status class
This class represents the HTTP status.
The detailed HTTP status when HTTP communication is performed can be obtained from code or reasonPhrase, but we have provided a method to easily determine whether HTTP communication succeeded or failed.
Constructors
- Status.from({required int code, required String reasonPhrase})
- Returns the new instance of Status based on arguments.
Properties
- code → int
-
The http status code
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isClientError → bool
-
Returns true if http status code is client error, otherwise false.
no setter
- isNotOk → bool
-
Returns true if http status code is not 200, otherwise false.
no setter
- isOk → bool
-
Returns true if http statuc code is 200, otherwise false.
no setter
- isServerError → bool
-
Returns true if http status code is server error, otherwise false.
no setter
- reasonPhrase → String
-
The reason phrase for code
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override