QueryState<T> constructor
QueryState<T> ({})
Implementation
QueryState({
required this.query,
required this.retryPolicy,
this.revalidate = const Duration(seconds: 60),
this.cache = true,
bool fetchOnInit = true,
Duration? refresh,
}) {
snapshot = AsyncSnapshot<T>.nothing();
expires = DateTime.now().add(revalidate);
if (refresh != null) {
setRefresh(refresh);
}
if (fetchOnInit) {
fetch();
}
}