IntHttpStatusExtension extension

An extension on the int type to facilitate the creation of HttpException instances based on HTTP status codes.

on

Methods

exception({String detail = '', Map<String, dynamic>? data, Uri? uri}) HttpException
This extension allows for a streamlined way to instantiate HttpException objects directly from integer status codes. It leverages the HttpStatus.fromCode method to create the corresponding HttpException for the given status code. Additional details such as a custom message, data payload, and URI can be optionally provided.