Server class Null safety

This Class Represents A Server http://www.example.com isHttp = true, host = www.example.com, port = -1

https://127.0.0.1:5588 isHttp = false, host = 127.0.0.1, port = 5588

Constructors

Server(String _id, String _host, int _port, bool _isHttp, CookieHandler _cookieHandler, Map<String, dynamic> _defaultHeader, Map<String, dynamic> _defaultBody)

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addRoute(ServerRoute serverRoute) → void
Adds Route To Server
getCookieHandler() CookieHandler
Return Server Cookies
getDefaultBody() Map<String, dynamic>
Returns Default Body
getDefaultHeader() Map<String, dynamic>
Returns Default Header
getId() String
Returns Server Id
getRoute(String id) ServerRoute
Returns Route By Id
getUri({String? routeId, Map<String, String>? replacements}) Uri
Returns Url With Given Route Path
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

fromHost(String id, String host, {bool isHttp = true, Map<String, dynamic>? defaultHeader, Map<String, dynamic>? defaultBody}) Future<Server>
Creates Server From Host
fromHostAndPort(String id, String host, int port, {bool isHttp = true, Map<String, dynamic>? defaultHeader, Map<String, dynamic>? defaultBody}) Future<Server>
Creates Server From Host And Port
localhost(String id, {bool withNumbers = false, bool isHttp = true, Map<String, dynamic>? defaultHeader, Map<String, dynamic>? defaultBody}) Future<Server>
Creates Server From Localhost