MangadexClient constructor
Implementation
MangadexClient(
{this.autoRefresh = true,
this.refreshDuration,
this.autoSave = false,
this.saveDirectory,
this.filename}) {
if (saveDirectory != null && filename != null && autoSave != false) {
loadFromLocation(saveDirectory!, filename)
.then((value) => _token = value);
}
_refreshTimer =
Timer.periodic(refreshDuration ?? Duration(minutes: 14), (timer) async {
if (_token != null) {
try {
_token = (await refresh(_token!.refresh!)).token;
log("Token Refreshed");
} on Exception {
_token = null;
}
}
});
}