Unverified Commit b3046a6c authored by Hans Muller's avatar Hans Muller Committed by GitHub

Update progress indicator API docs (#29564)

parent c4181b06
...@@ -28,11 +28,11 @@ const int _kIndeterminateLinearDuration = 1800; ...@@ -28,11 +28,11 @@ const int _kIndeterminateLinearDuration = 1800;
abstract class ProgressIndicator extends StatefulWidget { abstract class ProgressIndicator extends StatefulWidget {
/// Creates a progress indicator. /// Creates a progress indicator.
/// ///
/// The [value] argument can be either null (corresponding to an indeterminate /// {@template flutter.material.progressIndicator.parameters}
/// progress indicator) or non-null (corresponding to a determinate progress /// The [value] argument can either be null for an indeterminate
/// indicator). See [value] for details. /// progress indicator, or non-null for a determinate progress
/// indicator.
/// ///
/// {@template flutter.material.progressIndicator.semantics}
/// ## Accessibility /// ## Accessibility
/// ///
/// The [semanticsLabel] can be used to identify the purpose of this progress /// The [semanticsLabel] can be used to identify the purpose of this progress
...@@ -48,21 +48,23 @@ abstract class ProgressIndicator extends StatefulWidget { ...@@ -48,21 +48,23 @@ abstract class ProgressIndicator extends StatefulWidget {
this.semanticsValue, this.semanticsValue,
}) : super(key: key); }) : super(key: key);
/// If non-null, the value of this progress indicator with 0.0 corresponding /// If non-null, the value of this progress indicator.
/// to no progress having been made and 1.0 corresponding to all the progress ///
/// having been made. /// A value of 0.0 means no progress and 1.0 means that progress is complete.
/// ///
/// If null, this progress indicator is indeterminate, which means the /// If null, this progress indicator is indeterminate, which means the
/// indicator displays a predetermined animation that does not indicator how /// indicator displays a predetermined animation that does not indicate how
/// much actual progress is being made. /// much actual progress is being made.
final double value; final double value;
/// The progress indicator's background color. The current theme's /// The progress indicator's background color.
/// [ThemeData.backgroundColor] by default. ///
/// The current theme's [ThemeData.backgroundColor] by default.
final Color backgroundColor; final Color backgroundColor;
/// The indicator's color is the animation's value. To specify a constant /// The progress indicator's color as an animated value.
/// color use: `new AlwaysStoppedAnimation<Color>(color)`. ///
/// To specify a constant color use: `AlwaysStoppedAnimation<Color>(color)`.
/// ///
/// If null, the progress indicator is rendered with the current theme's /// If null, the progress indicator is rendered with the current theme's
/// [ThemeData.accentColor]. /// [ThemeData.accentColor].
...@@ -216,18 +218,19 @@ class _LinearProgressIndicatorPainter extends CustomPainter { ...@@ -216,18 +218,19 @@ class _LinearProgressIndicatorPainter extends CustomPainter {
/// made without indicating how much progress remains. To create an /// made without indicating how much progress remains. To create an
/// indeterminate progress indicator, use a null [value]. /// indeterminate progress indicator, use a null [value].
/// ///
/// The indicator line is displayed with [valueColor], an animated value. To
/// specify a constant color value use: `AlwaysStoppedAnimation<Color>(color)`.
///
/// See also: /// See also:
/// ///
/// * [CircularProgressIndicator] /// * [CircularProgressIndicator], which shows progress along a circular arc.
/// * [RefreshIndicator], which automatically displays a [CircularProgressIndicator]
/// when the underlying vertical scrollable is overscrolled.
/// * <https://material.io/design/components/progress-indicators.html#linear-progress-indicators> /// * <https://material.io/design/components/progress-indicators.html#linear-progress-indicators>
class LinearProgressIndicator extends ProgressIndicator { class LinearProgressIndicator extends ProgressIndicator {
/// Creates a linear progress indicator. /// Creates a linear progress indicator.
/// ///
/// The [value] argument can be either null (corresponding to an indeterminate /// {@macro flutter.material.progressIndicator.parameters}
/// progress indicator) or non-null (corresponding to a determinate progress
/// indicator). See [value] for details.
///
/// {@macro flutter.material.progressIndicator.semantics}
const LinearProgressIndicator({ const LinearProgressIndicator({
Key key, Key key,
double value, double value,
...@@ -396,18 +399,19 @@ class _CircularProgressIndicatorPainter extends CustomPainter { ...@@ -396,18 +399,19 @@ class _CircularProgressIndicatorPainter extends CustomPainter {
/// made without indicating how much progress remains. To create an /// made without indicating how much progress remains. To create an
/// indeterminate progress indicator, use a null [value]. /// indeterminate progress indicator, use a null [value].
/// ///
/// The indicator arc is displayed with [valueColor], an animated value. To
/// specify a constant color use: `AlwaysStoppedAnimation<Color>(color)`.
///
/// See also: /// See also:
/// ///
/// * [LinearProgressIndicator] /// * [LinearProgressIndicator], which displays progress along a line.
/// * [RefreshIndicator], which automatically displays a [CircularProgressIndicator]
/// when the underlying vertical scrollable is overscrolled.
/// * <https://material.io/design/components/progress-indicators.html#circular-progress-indicators> /// * <https://material.io/design/components/progress-indicators.html#circular-progress-indicators>
class CircularProgressIndicator extends ProgressIndicator { class CircularProgressIndicator extends ProgressIndicator {
/// Creates a circular progress indicator. /// Creates a circular progress indicator.
/// ///
/// The [value] argument can be either null (corresponding to an indeterminate /// {@macro flutter.material.progressIndicator.parameters}
/// progress indicator) or non-null (corresponding to a determinate progress
/// indicator). See [value] for details.
///
/// {@macro flutter.material.progressIndicator.semantics}
const CircularProgressIndicator({ const CircularProgressIndicator({
Key key, Key key,
double value, double value,
...@@ -588,16 +592,20 @@ class _RefreshProgressIndicatorPainter extends _CircularProgressIndicatorPainter ...@@ -588,16 +592,20 @@ class _RefreshProgressIndicatorPainter extends _CircularProgressIndicatorPainter
/// a complete implementation of swipe-to-refresh driven by a [Scrollable] /// a complete implementation of swipe-to-refresh driven by a [Scrollable]
/// widget. /// widget.
/// ///
/// The indicator arc is displayed with [valueColor], an animated value. To
/// specify a constant color use: `AlwaysStoppedAnimation<Color>(color)`.
///
/// See also: /// See also:
/// ///
/// * [RefreshIndicator] /// * [RefreshIndicator], which automatically displays a [CircularProgressIndicator]
/// when the underlying vertical scrollable is overscrolled.
class RefreshProgressIndicator extends CircularProgressIndicator { class RefreshProgressIndicator extends CircularProgressIndicator {
/// Creates a refresh progress indicator. /// Creates a refresh progress indicator.
/// ///
/// Rather than creating a refresh progress indicator directly, consider using /// Rather than creating a refresh progress indicator directly, consider using
/// a [RefreshIndicator] together with a [Scrollable] widget. /// a [RefreshIndicator] together with a [Scrollable] widget.
/// ///
/// {@macro flutter.material.progressIndicator.semantics} /// {@macro flutter.material.progressIndicator.parameters}
const RefreshProgressIndicator({ const RefreshProgressIndicator({
Key key, Key key,
double value, double value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment