LocalOrCachedNetworkImageProvider.fromFutures constructor
const
LocalOrCachedNetworkImageProvider.fromFutures({
- Key? key,
- required Future<
File?> ? fileFuture, - required Future<
String?> ? urlFuture, - double? scale = 1.0,
- bool fileMustExist = true,
- Map<
String, String> ? headers, - BaseCacheManager? cacheManager,
- String? cacheKey,
- int? maxWidth,
- int? maxHeight,
- bool asyncHeadFirst = false,
- Duration? networkTimeout,
- void onFileLoading()?,
- void onUrlLoading()?,
- void onFileLoaded(
- Object? err
- void onUrlLoaded(
- Object? err
Creates LocalOrCachedNetworkImageProvider with nullable fileFuture and urlFuture.
Implementation
const LocalOrCachedNetworkImageProvider.fromFutures({
// general
this.key,
required this.fileFuture,
required this.urlFuture,
this.scale = 1.0,
// local
this.fileMustExist = true,
// network
this.headers,
this.cacheManager,
this.cacheKey,
this.maxWidth,
this.maxHeight,
this.asyncHeadFirst = false,
this.networkTimeout,
// callbacks
this.onFileLoading,
this.onUrlLoading,
this.onFileLoaded,
this.onUrlLoaded,
}) : // general
_useFuture = true,
file = null,
url = null,
assert(fileFuture != null || urlFuture != null);