Skip to content

Commit

Permalink
update performance
Browse files Browse the repository at this point in the history
  • Loading branch information
redevrx committed Jan 9, 2024
1 parent a3b478c commit ba5ccc1
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_android-2.2.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2024-01-09 17:21:28.653743","version":"3.16.5"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_android-2.2.2/","native_build":true,"dependencies":[]}],"macos":[{"name":"path_provider_foundation","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_foundation-2.3.1/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/redev.rx/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2024-01-09 22:04:18.164722","version":"3.16.5"}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.0.4
- edit performance
## 0.0.3
- Refactor Download File
- Edit Load Image from cache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and the Flutter guide for
## Getting started

```dart
rxcache_network_image: 0.0.3
rxcache_network_image: 0.0.4
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.3"
version: "0.0.4"
sky_engine:
dependency: transitive
description: flutter
Expand Down
1 change: 1 addition & 0 deletions lib/src/cache_manager/rxcache_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class RxCacheManager with RxCacheManagerMixing {
final Uri resolved = Uri.base.resolve(url ?? '');
final fileName = key ?? resolved.pathSegments.lastOrNull;
final mFile = File("$cacheFolder/$fileName.bin");
if (url == null) return null;

try {
///
Expand Down
14 changes: 12 additions & 2 deletions lib/src/rxcache_image_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ class RxCacheImageProvider extends ImageProvider<RxCacheImageProvider> {
},
);

return decode(await ImmutableBuffer.fromUint8List(bytes!));
if (bytes == null) {
throw NetworkImageLoadException(
statusCode: HttpStatus.badRequest, uri: Uri.parse(url));
}

return decode(await ImmutableBuffer.fromUint8List(bytes));
}

///
Expand Down Expand Up @@ -219,7 +224,12 @@ class RxCacheImageProvider extends ImageProvider<RxCacheImageProvider> {
},
);

return decode(await ImmutableBuffer.fromUint8List(bytes!));
if (bytes == null) {
throw NetworkImageLoadException(
statusCode: HttpStatus.badRequest, uri: Uri.parse(url));
}

return decode(await ImmutableBuffer.fromUint8List(bytes));
}

///
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rxcache_network_image
description: "Easy download image from network and show in widget with rxcacheNetworkImage fast load image from network"
version: 0.0.3
version: 0.0.4
homepage: https://www.facebook.com/profile.php?id=100094077041664
repository: https://github.com/redevrx/RxCache_network_image

Expand Down

0 comments on commit ba5ccc1

Please sign in to comment.