|
@@ -100,7 +100,7 @@ class CachedNetworkImageProvider
|
|
|
final bool cached;
|
|
final bool cached;
|
|
|
final String? cacheKey;
|
|
final String? cacheKey;
|
|
|
final Widget? loadwidget;
|
|
final Widget? loadwidget;
|
|
|
-
|
|
|
|
|
|
|
+ final Map<String, String>? httpHeaders;
|
|
|
const CachedNetworkImageProvider({
|
|
const CachedNetworkImageProvider({
|
|
|
required this.imageUrl,
|
|
required this.imageUrl,
|
|
|
required this.cacheKey,
|
|
required this.cacheKey,
|
|
@@ -112,6 +112,7 @@ class CachedNetworkImageProvider
|
|
|
this.placeholder,
|
|
this.placeholder,
|
|
|
this.cached = true,
|
|
this.cached = true,
|
|
|
this.loadwidget = const CircularProgressIndicator(),
|
|
this.loadwidget = const CircularProgressIndicator(),
|
|
|
|
|
+ this.httpHeaders,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
@override
|
|
@@ -139,7 +140,11 @@ class CachedNetworkImageProvider
|
|
|
Future<ui.Codec> _loadAndDecodeImage(ImageDecoderCallback decode) async {
|
|
Future<ui.Codec> _loadAndDecodeImage(ImageDecoderCallback decode) async {
|
|
|
try {
|
|
try {
|
|
|
// 1. Отправляем HTTP‑запрос
|
|
// 1. Отправляем HTTP‑запрос
|
|
|
- HttpGetImage httpGetImage = HttpGetImage(url: imageUrl, count: count);
|
|
|
|
|
|
|
+ HttpGetImage httpGetImage = HttpGetImage(
|
|
|
|
|
+ url: imageUrl,
|
|
|
|
|
+ count: count,
|
|
|
|
|
+ httpHeaders: httpHeaders,
|
|
|
|
|
+ );
|
|
|
// 2. Декодируем байты в ui.Image
|
|
// 2. Декодируем байты в ui.Image
|
|
|
|
|
|
|
|
Uint8List img = await httpGetImage.getDataObjectIsolate();
|
|
Uint8List img = await httpGetImage.getDataObjectIsolate();
|