From 521bdaea05a0aeba55c3adf4a48d09abc15a304e Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Wed, 17 Jan 2018 17:47:47 -0800 Subject: [PATCH] Specify what image formats are supported in the API docs. (#13717) Depends on https://github.com/flutter/engine/pull/4483 --- packages/flutter/lib/src/painting/basic_types.dart | 2 +- packages/flutter/lib/src/painting/image_provider.dart | 2 ++ packages/flutter/lib/src/widgets/image.dart | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/painting/basic_types.dart b/packages/flutter/lib/src/painting/basic_types.dart index d9795585b96..58c3f3f216f 100644 --- a/packages/flutter/lib/src/painting/basic_types.dart +++ b/packages/flutter/lib/src/painting/basic_types.dart @@ -43,7 +43,7 @@ export 'dart:ui' show hashList; // Intentionally not exported: -// - Image, decodeImageFromDataPipe, decodeImageFromList: +// - Image, instantiateImageCodec, decodeImageFromList: // We use ui.* to make it very explicit that these are low-level image APIs. // Generally, higher layers provide more reasonable APIs around images. // - lerpDouble: diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart index c2df735b523..92a00d09313 100644 --- a/packages/flutter/lib/src/painting/image_provider.dart +++ b/packages/flutter/lib/src/painting/image_provider.dart @@ -168,6 +168,8 @@ class ImageConfiguration { /// The type argument does not have to be specified when using the type as an /// argument (where any image provider is acceptable). /// +/// The following image formats are supported: {@macro flutter.dart:ui.imageFormats} +/// /// ## Sample code /// /// The following shows the code required to write a widget that fully conforms diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart index f1655812c83..e661887dee9 100644 --- a/packages/flutter/lib/src/widgets/image.dart +++ b/packages/flutter/lib/src/widgets/image.dart @@ -92,6 +92,8 @@ Future precacheImage(ImageProvider provider, BuildContext context, { Size /// * [new Image.file], for obtaining an image from a [File]. /// * [new Image.memory], for obtaining an image from a [Uint8List]. /// +/// The following image formats are supported: {@macro flutter.dart:ui.imageFormats} +/// /// To automatically perform pixel-density-aware asset resolution, specify the /// image using an [AssetImage] and make sure that a [MaterialApp], [WidgetsApp], /// or [MediaQuery] widget exists above the [Image] widget in the widget tree.