-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Remove deprecated ImageProvider
methods
#4725
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
Merged
auto-submit
merged 8 commits into
flutter:main
from
LongCatIsLooong:remove-ImageProvider-load
Aug 22, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9267f3b
Remove deprecated `ImageProvider` methods
LongCatIsLooong a0500a0
bump version
LongCatIsLooong 1193fc8
fix backward compatibility
LongCatIsLooong 0bdaf23
format
LongCatIsLooong 3a716c3
Merge remote-tracking branch 'upstream/main' into remove-ImageProvide…
LongCatIsLooong 7666032
Migrate `ImageProvider.load` to `ImageProvider.loadImage`
LongCatIsLooong 8492fd9
Revert "Migrate `ImageProvider.load` to `ImageProvider.loadImage`"
LongCatIsLooong 286157c
bump version
LongCatIsLooong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,12 +140,12 @@ void assertThatImageLoadingFails( | |
NetworkImageWithRetry subject, | ||
List<FlutterErrorDetails> errorLog, | ||
) { | ||
final ImageStreamCompleter completer = subject.load( | ||
final ImageStreamCompleter completer = subject.loadBuffer( | ||
subject, | ||
// TODO(cyanglaz): migrate to use the new APIs | ||
// https://github.com/flutter/flutter/issues/105336 | ||
// TODO(LongCatIsLooong): migrate to use new `instantiateImageCodecWithSize` API. | ||
// https://github.com/flutter/flutter/issues/132856 | ||
// ignore: deprecated_member_use | ||
PaintingBinding.instance.instantiateImageCodec, | ||
PaintingBinding.instance.instantiateImageCodecFromBuffer, | ||
); | ||
completer.addListener(ImageStreamListener( | ||
(ImageInfo image, bool synchronousCall) {}, | ||
|
@@ -160,12 +160,12 @@ void assertThatImageLoadingFails( | |
void assertThatImageLoadingSucceeds( | ||
NetworkImageWithRetry subject, | ||
) { | ||
final ImageStreamCompleter completer = subject.load( | ||
final ImageStreamCompleter completer = subject.loadBuffer( | ||
subject, | ||
// TODO(cyanglaz): migrate to use the new APIs | ||
// https://github.com/flutter/flutter/issues/105336 | ||
// TODO(LongCatIsLooong): migrate to use new `instantiateImageCodecWithSize` API. | ||
// https://github.com/flutter/flutter/issues/132856 | ||
// ignore: deprecated_member_use | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here. |
||
PaintingBinding.instance.instantiateImageCodec, | ||
PaintingBinding.instance.instantiateImageCodecFromBuffer, | ||
); | ||
completer.addListener(ImageStreamListener( | ||
expectAsync2((ImageInfo image, bool synchronousCall) { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This replacement is also deprecated?
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.
Yeah the up-to-date APIs are only available in >v3.7.0 unfortunately. Included in the new issue.