Skip to content

Commit 692376b

Browse files
authored
🚸 Precache captured image for better experience (#145)
1 parent 7968453 commit 692376b

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ that can be found in the LICENSE file. -->
44

55
# Changelog
66

7+
## 3.6.4
8+
9+
### Improvements
10+
11+
- Precache captured image for better experience. (#145)
12+
713
## 3.6.3
814

915
### Improvements

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat_camera_picker_demo
22
description: A new Flutter project.
3-
version: 3.6.3+19
3+
version: 3.6.4+20
44
publish_to: none
55

66
environment:

lib/src/states/camera_picker_state.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ class CameraPickerState extends State<CameraPicker>
719719
Future<AssetEntity?> pushToViewer({
720720
required XFile file,
721721
required CameraPickerViewType viewType,
722-
}) {
722+
}) async {
723+
if (viewType == CameraPickerViewType.image) {
724+
await precacheImage(FileImage(File(file.path)), context);
725+
}
723726
return CameraPickerViewer.pushToViewer(
724727
context,
725728
pickerConfig: pickerConfig,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: wechat_camera_picker
22
description: A camera picker based on WeChat's UI which is a separate runnable extension to wechat_assets_picker.
33
repository: https://github.com/fluttercandies/flutter_wechat_camera_picker
4-
version: 3.6.3
4+
version: 3.6.4
55

66
environment:
77
sdk: ">=2.14.0 <3.0.0"

0 commit comments

Comments
 (0)