From 46d074014b20300168afe7894550fb53a8fb53ac Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 27 Jul 2023 16:25:04 -0700 Subject: [PATCH] [framework] clean up image provider documentation. (#131416) Fixes https://github.com/flutter/flutter/issues/130524 loadBuffer was superseded by loadImage --- .../lib/src/painting/image_provider.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/flutter/lib/src/painting/image_provider.dart b/packages/flutter/lib/src/painting/image_provider.dart index cc929d8701..57aabc1de9 100644 --- a/packages/flutter/lib/src/painting/image_provider.dart +++ b/packages/flutter/lib/src/painting/image_provider.dart @@ -162,8 +162,8 @@ class ImageConfiguration { /// Performs the decode process for use in [ImageProvider.load]. /// -/// This typedef is deprecated. Use [DecoderBufferCallback] with -/// [ImageProvider.loadBuffer] instead. +/// This typedef is deprecated. Use [ImageDecoderCallback] with +/// [ImageProvider.loadImage] instead. /// /// This callback allows decoupling of the `cacheWidth`, `cacheHeight`, and /// `allowUpscaling` parameters from implementations of [ImageProvider] that do @@ -247,16 +247,16 @@ typedef ImageDecoderCallback = Future Function( /// using that key. This is handled by [resolveStreamForKey]. That method /// may fizzle if it determines the image is no longer necessary, use the /// provided [ImageErrorListener] to report an error, set the completer -/// from the cache if possible, or call [loadBuffer] to fetch the encoded image +/// from the cache if possible, or call [loadImage] to fetch the encoded image /// bytes and schedule decoding. -/// 4. The [loadBuffer] method is responsible for both fetching the encoded bytes +/// 4. The [loadImage] method is responsible for both fetching the encoded bytes /// and decoding them using the provided [DecoderCallback]. It is called /// in a context that uses the [ImageErrorListener] to report errors back. /// -/// Subclasses normally only have to implement the [loadBuffer] and [obtainKey] +/// Subclasses normally only have to implement the [loadImage] and [obtainKey] /// methods. A subclass that needs finer grained control over the [ImageStream] /// type must override [createStream]. A subclass that needs finer grained -/// control over the resolution, such as delaying calling [loadBuffer], must override +/// control over the resolution, such as delaying calling [loadImage], must override /// [resolveStreamForKey]. /// /// The [resolve] method is marked as [nonVirtual] so that [ImageProvider]s can @@ -610,9 +610,9 @@ abstract class ImageProvider { /// Converts a key into an [ImageStreamCompleter], and begins fetching the /// image. /// - /// This method is deprecated. Implement [loadBuffer] for faster image - /// loading. Only one of [load] and [loadBuffer] must be implemented, and - /// [loadBuffer] is preferred. + /// This method is deprecated. Implement [loadImage] for faster image + /// loading. Only one of [load] and [loadImage] must be implemented, and + /// [loadImage] is preferred. /// /// The [decode] callback provides the logic to obtain the codec for the /// image. @@ -626,7 +626,7 @@ abstract class ImageProvider { 'This feature was deprecated after v2.13.0-1.0.pre.', ) ImageStreamCompleter load(T key, DecoderCallback decode) { - throw UnsupportedError('Implement loadBuffer for faster image loading'); + throw UnsupportedError('Implement loadImage for faster image loading'); } /// Converts a key into an [ImageStreamCompleter], and begins fetching the