Vovan 1 maand geleden
bovenliggende
commit
d560afd78a
2 gewijzigde bestanden met toevoegingen van 9 en 6 verwijderingen
  1. 7 5
      lib/src/CashedNetworkImageWidget.dart
  2. 2 1
      lib/src/http_request.dart

+ 7 - 5
lib/src/CashedNetworkImageWidget.dart

@@ -23,13 +23,14 @@ class CachedNetworkImageWidget extends StatelessWidget {
   final Widget? placeholder;
   final Widget? errorWidget;
   final bool cached;
-  final String? cachkey;
+  final Map<String, String>? httpHeaders;
+  final String? cacheKey;
   final Widget? loadwidget;
 
   const CachedNetworkImageWidget({
     super.key,
     required this.imageUrl,
-    required this.cachkey,
+    required this.cacheKey,
     required this.fit,
     this.count = 10,
     this.height,
@@ -38,6 +39,7 @@ class CachedNetworkImageWidget extends StatelessWidget {
     this.placeholder,
     this.cached = true,
     this.loadwidget = const CircularProgressIndicator(),
+    this.httpHeaders,
   });
 
   @override
@@ -49,7 +51,7 @@ class CachedNetworkImageWidget extends StatelessWidget {
             url: imageUrl,
             cached: cached,
             count: count,
-            cachkey: cachkey,
+            cachkey: cacheKey,
           ),
         ),
       child: Builder(
@@ -96,12 +98,12 @@ class CachedNetworkImageProvider
   final Widget? placeholder;
   final Widget? errorWidget;
   final bool cached;
-  final String? cachkey;
+  final String? cacheKey;
   final Widget? loadwidget;
 
   const CachedNetworkImageProvider({
     required this.imageUrl,
-    required this.cachkey,
+    required this.cacheKey,
     required this.fit,
     this.count = 10,
     this.height,

+ 2 - 1
lib/src/http_request.dart

@@ -5,7 +5,8 @@ import 'package:http/http.dart' as http;
 class HttpGetImage {
   final String url;
   final int count;
-  HttpGetImage({required this.url, required this.count});
+  final Map<String, String>? httpHeaders;
+  HttpGetImage({required this.url, required this.count, this.httpHeaders});
 
   Future<Uint8List> getDataObjectIsolate() async {
     final ReceivePort receivePort = ReceivePort();