Update image docs that Image.file() cashes file (#62301)
This commit is contained in:
@@ -837,6 +837,9 @@ abstract class NetworkImage extends ImageProvider<NetworkImage> {
|
||||
/// Decodes the given [File] object as an image, associating it with the given
|
||||
/// scale.
|
||||
///
|
||||
/// The provider does not monitor the file for changes. If you expect the
|
||||
/// underlying data to change, you should call the [evict] method.
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [Image.file] for a shorthand of an [Image] widget backed by [FileImage].
|
||||
|
||||
@@ -436,6 +436,15 @@ class Image extends StatefulWidget {
|
||||
/// will be rendered to the constraints of the layout or [width] and [height]
|
||||
/// regardless of these parameters. These parameters are primarily intended
|
||||
/// to reduce the memory usage of [ImageCache].
|
||||
///
|
||||
/// Loading an image from a file creates an in memory copy of the file,
|
||||
/// which is retained in the [ImageCache]. The underlying file is not
|
||||
/// monitored for changes. If it does change, the application should evict
|
||||
/// the entry from the [ImageCache].
|
||||
///
|
||||
/// See also:
|
||||
///
|
||||
/// * [FileImage] provider for evicting the underlying file easily.
|
||||
Image.file(
|
||||
File file, {
|
||||
Key key,
|
||||
|
||||
Reference in New Issue
Block a user