Unverified Commit becf09c5 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Update various API docs (#72548)

parent 1c18cf3d
......@@ -507,6 +507,10 @@ class AnimationController extends Animation<double>
/// regardless of whether `target` > [value] or not. At the end of the
/// animation, when `target` is reached, [status] is reported as
/// [AnimationStatus.completed].
///
/// If the `target` argument is the same as the current [value] of the
/// animation, then this won't animate, and the returned [TickerFuture] will
/// be already complete.
TickerFuture animateTo(double target, { Duration? duration, Curve curve = Curves.linear }) {
assert(() {
if (this.duration == null && duration == null) {
......
......@@ -68,7 +68,7 @@ mixin PaintingBinding on BindingBase, ServicesBinding {
@protected
ImageCache createImageCache() => ImageCache();
/// Calls through to [dart:ui] from [ImageCache].
/// Calls through to [dart:ui.instantiateImageCodec] from [ImageCache].
///
/// The `cacheWidth` and `cacheHeight` parameters, when specified, indicate
/// the size to decode the image to.
......
......@@ -928,9 +928,21 @@ class MemoryImage extends ImageProvider<MemoryImage> {
assert(scale != null);
/// The bytes to decode into an image.
///
/// The bytes represent encoded image bytes and can be encoded in any of the
/// following supported image formats: {@macro flutter.dart:ui.imageFormats}
///
/// See also:
///
/// * [PaintingBinding.instantiateImageCodec]
final Uint8List bytes;
/// The scale to place in the [ImageInfo] object of the image.
///
/// See also:
///
/// * [ImageInfo.scale], which gives more information on how this scale is
/// applied.
final double scale;
@override
......
......@@ -105,11 +105,13 @@ class ImageInfo {
///
/// The scale factor applies to the width and the height.
///
/// For example, if this is 2.0 it means that there are four image pixels for
/// {@template flutter.painting.imageInfo.scale}
/// For example, if this is 2.0, it means that there are four image pixels for
/// every one logical pixel, and the image's actual width and height (as given
/// by the [dart:ui.Image.width] and [dart:ui.Image.height] properties) are
/// double the height and width that should be used when painting the image
/// (e.g. in the arguments given to [Canvas.drawImage]).
/// {@endtemplate}
final double scale;
/// A string used for debugging purposes to identify the source of this image.
......
......@@ -296,6 +296,14 @@ class Ticker {
/// Release the resources used by this object. The object is no longer usable
/// after this method is called.
///
/// It is legal to call this method while [isActive] is true, in which case:
///
/// * The frame callback that was requested by [scheduleTick], if any, is
/// canceled.
/// * The future that was returned by [start] does not resolve.
/// * The future obtained from [TickerFuture.orCancel], if any, resolves
/// with a [TickerCanceled] error.
@mustCallSuper
void dispose() {
if (_future != null) {
......
......@@ -649,7 +649,15 @@ class Image extends StatefulWidget {
/// Creates a widget that displays an [ImageStream] obtained from a [Uint8List].
///
/// The [bytes], [scale], and [repeat] arguments must not be null.
/// The `bytes` argument specifies encoded image bytes, which can be encoded
/// in any of the following supported image formats:
/// {@macro flutter.dart:ui.imageFormats}
///
/// The `scale` argument specifies the linear scale factor for drawing this
/// image at its intended size and applies to both the width and the height.
/// {@macro flutter.painting.imageInfo.scale}
///
/// The `bytes`, `scale`, and [repeat] arguments must not be null.
///
/// This only accepts compressed image formats (e.g. PNG). Uncompressed
/// formats like rawRgba (the default format of [dart:ui.Image.toByteData])
......
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