From 5f4658973be1ad10a59a0a278b6cdf41b10fe7f6 Mon Sep 17 00:00:00 2001 From: Per Classon Date: Mon, 10 Feb 2020 19:08:02 +0100 Subject: [PATCH] Update RefreshIndicator documentation to clarify the need for the child for be scrollable (#50345) --- .../lib/src/material/refresh_indicator.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/flutter/lib/src/material/refresh_indicator.dart b/packages/flutter/lib/src/material/refresh_indicator.dart index b1363acc75..d63b33a2ea 100644 --- a/packages/flutter/lib/src/material/refresh_indicator.dart +++ b/packages/flutter/lib/src/material/refresh_indicator.dart @@ -56,19 +56,23 @@ enum _RefreshIndicatorMode { /// scrollable's contents and then complete the [Future] it returns. The refresh /// indicator disappears after the callback's [Future] has completed. /// -/// If the [Scrollable] might not have enough content to overscroll, consider -/// settings its `physics` property to [AlwaysScrollableScrollPhysics]: +/// ## Troubleshooting +/// +/// ### Refresh indicator does not show up +/// +/// The [RefreshIndicator] will appear if its scrollable descendant can be +/// overscrolled, i.e. if the scrollable's content is bigger than its viewport. +/// To ensure that the [RefreshIndicator] will always appear, even if the +/// scrollable's content fits within its viewport, set the scrollable's +/// [Scrollable.physics] property to [AlwaysScrollableScrollPhysics]: /// /// ```dart /// ListView( /// physics: const AlwaysScrollableScrollPhysics(), /// children: ... -// ) +/// ) /// ``` /// -/// Using [AlwaysScrollableScrollPhysics] will ensure that the scroll view is -/// always scrollable and, therefore, can trigger the [RefreshIndicator]. -/// /// A [RefreshIndicator] can only be used with a vertical scroll view. /// /// See also: