From caaff4b9b70530510749c5a2243cada37d8ffdba Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 18 Jul 2024 09:22:16 -0700 Subject: [PATCH] Small fixes to Image docs: NNBD, and add a cross-reference (#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.) --- packages/flutter/lib/src/widgets/image.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart index e19a92f936fe..5e532745793e 100644 --- a/packages/flutter/lib/src/widgets/image.dart +++ b/packages/flutter/lib/src/widgets/image.dart @@ -152,8 +152,8 @@ Future 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. /// @@ -174,8 +174,6 @@ Future 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] @@ -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] @@ -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]. ///