New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/image optimize #879
Feat/image optimize #879
Conversation
lazy 加载图片报错 ======== Exception caught by image resource service ================================================ Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause. When the exception was thrown, this was the stack: |
e02bf6b
to
0b0eeb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要恢复 naturalWidth/Height 的实现
done |
dbd18da
to
93dc38d
Compare
…to feat/image-optimize
…ext' into feat/image-optimize
CI 没有通过 |
import 'dart:io'; | ||
import 'dart:ui'; | ||
import 'dart:typed_data'; | ||
|
||
import 'package:flutter/cupertino.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面这个 import 有点问题, 不知道啥时候引入的
} | ||
|
||
int naturalWidth = 0; | ||
int naturalHeight = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
做成没有 setter 会好一点, 这样貌似可以外部修改
// load again, but still update the image cache with LRU information. | ||
if (stream.completer != null) { | ||
final ImageStreamCompleter? completer = | ||
PaintingBinding.instance!.imageCache!.putIfAbsent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不用换行的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No logical problems.
Fixed #865