unAuthCode property
dynamic
get
unAuthCode
Implementation
static get unAuthCode => _unAuthCode;
set
unAuthCode
(dynamic code)
setter for unAuthCode which decide when http client need
to redirect to login route.
Note: unAuthCode can not be 0
, which is reserved for SUCCESS.
Implementation
static set unAuthCode(dynamic code) {
assert(code is int || code is String || code is List<int>,
"invalid type of unAuthCode!");
if (code is int || code is String) {
_unAuthCode = code
.toString()
.split("|")
.map((cc) => int.parse(cc))
.where((cc) => cc != 0)
.toList();
} else {
_unAuthCode = code.where((cc) => cc != 0).toList();
}
}