Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
cb5918f6
Commit
cb5918f6
authored
Jan 17, 2020
by
Michael Goderbauer
Committed by
Flutter GitHub Bot
Jan 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doc fixes in Image related docs (#48994)
parent
d0c4458b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
image_cache.dart
packages/flutter/lib/src/painting/image_cache.dart
+6
-6
image_stream.dart
packages/flutter/lib/src/painting/image_stream.dart
+6
-6
No files found.
packages/flutter/lib/src/painting/image_cache.dart
View file @
cb5918f6
...
...
@@ -32,7 +32,7 @@ const int _kDefaultSizeBytes = 100 << 20; // 100 MiB
/// {@tool snippet}
///
/// This sample shows how to supply your own caching logic and replace the
/// global [imageCache] varible.
/// global [imageCache] vari
a
ble.
///
/// ```dart
/// /// This is the custom implementation of [ImageCache] where we can override
...
...
@@ -64,7 +64,6 @@ const int _kDefaultSizeBytes = 100 << 20; // 100 MiB
/// }
/// ```
/// {@end-tool}
class
ImageCache
{
final
Map
<
Object
,
_PendingImage
>
_pendingImages
=
<
Object
,
_PendingImage
>{};
final
Map
<
Object
,
_CachedImage
>
_cache
=
<
Object
,
_CachedImage
>{};
...
...
@@ -141,12 +140,13 @@ class ImageCache {
}
/// Evicts a single entry from the cache, returning true if successful.
/// Pending images waiting for completion are removed as well, returning true if successful.
/// Pending images waiting for completion are removed as well, returning true
/// if successful.
///
/// When a pending image is removed the listener on it is removed as well to
prevent
/// it from adding itself to the cache if it eventually completes.
/// When a pending image is removed the listener on it is removed as well to
///
prevent
it from adding itself to the cache if it eventually completes.
///
/// The
[key]
must be equal to an object used to cache an image in
/// The
`key`
must be equal to an object used to cache an image in
/// [ImageCache.putIfAbsent].
///
/// If the key is not immediately available, as is common, consider using
...
...
packages/flutter/lib/src/painting/image_stream.dart
View file @
cb5918f6
...
...
@@ -15,7 +15,7 @@ import 'package:flutter/scheduler.dart';
/// actual data of the image once it has been obtained.
@immutable
class
ImageInfo
{
/// Creates an [ImageInfo] object for the given
image and scale
.
/// Creates an [ImageInfo] object for the given
[image] and [scale]
.
///
/// Both the image and the scale must not be null.
const
ImageInfo
({
@required
this
.
image
,
this
.
scale
=
1.0
})
...
...
@@ -35,9 +35,9 @@ class ImageInfo {
///
/// 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 th
e
/// arguments given to [Canvas.drawImage]).
/// 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 imag
e
///
(e.g. in the
arguments given to [Canvas.drawImage]).
final
double
scale
;
@override
...
...
@@ -58,11 +58,11 @@ class ImageInfo {
/// Interface for receiving notifications about the loading of an image.
///
/// This class overrides
`operator ==` and `hashCode`
to compare the individual
/// This class overrides
[operator ==] and [hashCode]
to compare the individual
/// callbacks in the listener, meaning that if you add an instance of this class
/// as a listener (e.g. via [ImageStream.addListener]), you can instantiate a
/// _different_ instance of this class when you remove the listener, and the
/// listener will be properly removed as long all associated callbacks are
/// listener will be properly removed as long a
s a
ll associated callbacks are
/// equal.
///
/// Used by [ImageStream] and [ImageStreamCompleter].
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment