Skip to content

Commit caaff4b

Browse files
authored
Small fixes to Image docs: NNBD, and add a cross-reference (flutter#151938)
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.)
1 parent 36dac29 commit caaff4b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/flutter/lib/src/widgets/image.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ Future<void> precacheImage(
152152
/// Signature used by [Image.frameBuilder] to control the widget that will be
153153
/// used when an [Image] is built.
154154
///
155-
/// The `child` argument contains the default image widget and is guaranteed to
156-
/// be non-null. Typically, this builder will wrap the `child` widget in some
155+
/// The `child` argument contains the default image widget.
156+
/// Typically, this builder will wrap the `child` widget in some
157157
/// way and return the wrapped widget. If this builder returns `child` directly,
158158
/// it will yield the same result as if [Image.frameBuilder] was null.
159159
///
@@ -174,8 +174,6 @@ Future<void> precacheImage(
174174
/// frames. In other words, if the first image frame was available immediately,
175175
/// then this argument will be true for all image frames.
176176
///
177-
/// This builder must not return null.
178-
///
179177
/// See also:
180178
///
181179
/// * [Image.frameBuilder], which makes use of this signature in the [Image]
@@ -212,8 +210,6 @@ typedef ImageFrameBuilder = Widget Function(
212210
/// In such cases, the `child` parameter will represent the current
213211
/// fully-loaded image frame.
214212
///
215-
/// This builder must not return null.
216-
///
217213
/// See also:
218214
///
219215
/// * [Image.loadingBuilder], which makes use of this signature in the [Image]
@@ -712,6 +708,9 @@ class Image extends StatefulWidget {
712708
/// add effects to the image (such as fading the image in when it becomes
713709
/// available) or to display a placeholder widget while the image is loading.
714710
///
711+
/// For more information on how to interpret the arguments that are passed to
712+
/// this builder, see the documentation on [ImageFrameBuilder].
713+
///
715714
/// To have finer-grained control over the way that an image's loading
716715
/// progress is communicated to the user, see [loadingBuilder].
717716
///

0 commit comments

Comments
 (0)