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
Sample code for ImageProvider #131952
Sample code for ImageProvider #131952
Conversation
9cdd279
to
b45c51d
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.
LGTM
if (configuration.platform == null) | ||
'platform': null.toString(), | ||
if (configuration.platform != null) | ||
'platform': configuration.platform!.toString().substring('$TargetPlatform'.length + 1), |
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.
Isn't configuration.platform
an enum so this could be simplified to:
if (configuration.platform == null) | |
'platform': null.toString(), | |
if (configuration.platform != null) | |
'platform': configuration.platform!.toString().substring('$TargetPlatform'.length + 1), | |
'platform': configuration.platform?.name ?? null.toString(), |
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.
oh I always forget about EnumName because it's not in the API docs for Enum
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.
Right! Send a PR to add it? ;)
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.
it simplified even more than you suggested, heh
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.
Beautiful!
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.
Submitted dart-lang/sdk#53164 for the Enum doc issue.
if (configuration.textDirection == null) | ||
'bidi': null.toString(), | ||
if (configuration.textDirection == TextDirection.ltr) | ||
'bidi': 'ltr', | ||
if (configuration.textDirection == TextDirection.rtl) | ||
'bidi': 'rtl', |
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.
if (configuration.textDirection == null) | |
'bidi': null.toString(), | |
if (configuration.textDirection == TextDirection.ltr) | |
'bidi': 'ltr', | |
if (configuration.textDirection == TextDirection.rtl) | |
'bidi': 'rtl', | |
'bidi': configuration.textDirection?.name ?? null.toString(), |
debugPrint('Fetching "$key"...'); | ||
return MultiFrameImageStreamCompleter( | ||
codec: | ||
_httpClient.getUrl(key) |
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.
nit: formatting here seems off. Maybe move this to the previous line (or indent the .then
lines further)?
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.
done
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.
LGTM
auto label is removed for flutter/flutter/131952, due to - The status or check suite Linux web_canvaskit_tests_3 has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Also: - minor improvements to documentation - wrap one of our test error messages in a manner more consistent with other messages
Also: