Update image docs that Image.file() cashes file (#62301)

This commit is contained in:
Juyeong Lee
2020-07-30 13:31:03 +09:00
committed by GitHub
parent 234d8fac4d
commit 26f9d734e9
2 changed files with 12 additions and 0 deletions

View File

@@ -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].

View File

@@ -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,