Skip to content

Commit

Permalink
Small fixes to Image docs: NNBD, and add a cross-reference (#151938)
Browse files Browse the repository at this point in the history
In particular, without this cross-reference it's easy for a reader
looking at [Image.frameBuilder] to think that the meanings of these
parameters just aren't properly documented.  (I had that thought for
a minute, before thinking *surely* they're documented, and then
trying the link to the typedef.)
  • Loading branch information
gnprice authored Jul 18, 2024
1 parent 36dac29 commit caaff4b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/flutter/lib/src/widgets/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ Future<void> precacheImage(
/// Signature used by [Image.frameBuilder] to control the widget that will be
/// used when an [Image] is built.
///
/// The `child` argument contains the default image widget and is guaranteed to
/// be non-null. Typically, this builder will wrap the `child` widget in some
/// The `child` argument contains the default image widget.
/// Typically, this builder will wrap the `child` widget in some
/// way and return the wrapped widget. If this builder returns `child` directly,
/// it will yield the same result as if [Image.frameBuilder] was null.
///
Expand All @@ -174,8 +174,6 @@ Future<void> precacheImage(
/// frames. In other words, if the first image frame was available immediately,
/// then this argument will be true for all image frames.
///
/// This builder must not return null.
///
/// See also:
///
/// * [Image.frameBuilder], which makes use of this signature in the [Image]
Expand Down Expand Up @@ -212,8 +210,6 @@ typedef ImageFrameBuilder = Widget Function(
/// In such cases, the `child` parameter will represent the current
/// fully-loaded image frame.
///
/// This builder must not return null.
///
/// See also:
///
/// * [Image.loadingBuilder], which makes use of this signature in the [Image]
Expand Down Expand Up @@ -712,6 +708,9 @@ class Image extends StatefulWidget {
/// add effects to the image (such as fading the image in when it becomes
/// available) or to display a placeholder widget while the image is loading.
///
/// For more information on how to interpret the arguments that are passed to
/// this builder, see the documentation on [ImageFrameBuilder].
///
/// To have finer-grained control over the way that an image's loading
/// progress is communicated to the user, see [loadingBuilder].
///
Expand Down

0 comments on commit caaff4b

Please sign in to comment.