Skip to content

Commit

Permalink
publish platform_interface and web implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
renefloor committed Aug 31, 2022
1 parent 43fae1a commit 0f76edf
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 35 deletions.
12 changes: 2 additions & 10 deletions cached_network_image/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,8 @@ dependencies:
sdk: flutter
flutter_cache_manager: ^3.3.0
octo_image: ^1.0.0
cached_network_image_platform_interface:
git:
url: https://github.com/Baseflow/flutter_cached_network_image.git
ref: 97fbb84e4149e0fce8d8641c57d742531371407d
path: cached_network_image_platform_interface
cached_network_image_web:
git:
url: https://github.com/Baseflow/flutter_cached_network_image.git
ref: 66e18eb5c9b89dd457a776e656bb6663cb9a784d
path: cached_network_image_web
cached_network_image_platform_interface: ^2.0.0
cached_network_image_web: ^1.0.2


dev_dependencies:
Expand Down
3 changes: 3 additions & 0 deletions cached_network_image_platform_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
## [2.0.0] - 2022-08-31
* Added loadBufferAsync for Flutter 3.3

## [1.0.0] - 2021-07-16
* Initial release
2 changes: 1 addition & 1 deletion cached_network_image_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cached_network_image_platform_interface
description: Platform interface for CachedNetworkImage
version: 1.0.0
version: 2.0.0
homepage: https://github.com/Baseflow/flutter_cached_network_image

environment:
Expand Down
3 changes: 3 additions & 0 deletions cached_network_image_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [1.0.2] - 2022-08-31
* Added loadBufferAsync and deprecated loadAsync

## [1.0.1] - 2021-08-02
* Bug: fixed CORS issues in HTML image version.

Expand Down
32 changes: 14 additions & 18 deletions cached_network_image_web/lib/cached_network_image_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,19 @@ class ImageLoader implements platform.ImageLoader {
ImageRenderMethodForWeb imageRenderMethodForWeb,
Function() evictImage,
) {
switch (imageRenderMethodForWeb) {
case ImageRenderMethodForWeb.HttpGet:
return _loadAsyncHttpGet(
url,
cacheKey,
chunkEvents,
decode,
cacheManager,
maxHeight,
maxWidth,
headers,
errorListener,
evictImage,
);
case ImageRenderMethodForWeb.HtmlImage:
return _loadAsyncHtmlImage(url, chunkEvents).asStream();
}
return _load(
url,
cacheKey,
chunkEvents,
decode,
cacheManager,
maxHeight,
maxWidth,
headers,
errorListener,
imageRenderMethodForWeb,
evictImage,
);
}

@override
Expand All @@ -64,7 +60,7 @@ class ImageLoader implements platform.ImageLoader {
ImageRenderMethodForWeb imageRenderMethodForWeb,
Function() evictImage,
) {
_load(
return _load(
url,
cacheKey,
chunkEvents,
Expand Down
8 changes: 2 additions & 6 deletions cached_network_image_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cached_network_image_web
description: Web implementation of CachedNetworkImage
version: 1.0.1
version: 1.0.2
homepage: https://github.com/Baseflow/flutter_cached_network_image

environment:
Expand All @@ -11,11 +11,7 @@ dependencies:
flutter:
sdk: flutter
flutter_cache_manager: ^3.0.0
cached_network_image_platform_interface:
git:
url: https://github.com/Baseflow/flutter_cached_network_image.git
ref: 97fbb84e4149e0fce8d8641c57d742531371407d
path: cached_network_image_platform_interface
cached_network_image_platform_interface: ^2.0.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 0f76edf

Please sign in to comment.