Commit 9d900ea7 authored by Adam Barth's avatar Adam Barth

Improve dartdoc for extent callbacks (#3514)

Fixes #3510
parent e7f33586
......@@ -201,6 +201,20 @@ class _LazyBlockState extends ScrollableState<LazyBlock> {
}
/// Signature used by [LazyBlockViewport] to report its interior and exterior dimensions.
///
/// * The [contentExtent] is the interior dimension of the viewport (i.e., the
/// size of the thing that's being viewed through the viewport).
/// * The [containerExtent] is the exterior dimension of the viewport (i.e.,
/// the amount of the thing inside the viewport that is visible from outside
/// the viewport).
/// * The [minScrollOffset] is the offset at which the starting edge of the
/// first item in the viewport is aligned with the starting edge of the
/// viewport. (As the scroll offset increases, items with larger indices are
/// revealed in the viewport.) Typically the min scroll offset is 0.0, but
/// because [LazyBlockViewport] uses dead reckoning, the min scroll offset
/// might not always be 0.0. For example, if an item that's offscreen changes
/// size, the visible items will retain their current scroll offsets even if
/// the distance to the starting edge of the first item changes.
typedef void LazyBlockExtentsChangedCallback(double contentExtent, double containerExtent, double minScrollOffset);
/// A viewport on an infinite list of variable height children.
......
......@@ -10,6 +10,13 @@ import 'framework.dart';
import 'package:flutter/rendering.dart';
/// Signature for reporting the interior and exterior dimensions of a viewport.
///
/// * The [contentExtent] is the interior dimension of the viewport (i.e., the
/// size of the thing that's being viewed through the viewport).
/// * The [containerExtent] is the exterior dimension of the viewport (i.e.,
/// the amount of the thing inside the viewport that is visible from outside
/// the viewport).
typedef void ExtentsChangedCallback(double contentExtent, double containerExtent);
/// An abstract widget whose children are not all materialized.
......
......@@ -81,7 +81,7 @@ class NineSliceSprite extends NodeWithSize with SpritePaint {
List<Point> _vertices;
List<Point> _textureCoordinates;
List<Color> _colors;
List<int> _indicies;
List<int> _indices;
@override
void paint(Canvas canvas) {
......@@ -157,7 +157,7 @@ class NineSliceSprite extends NodeWithSize with SpritePaint {
}
// Build indices.
_indicies = <int>[];
_indices = <int>[];
for (int y = 0; y < 3; y += 1) {
for (int x = 0; x < 3; x += 1) {
// Check if we should skip the middle rectangle.
......@@ -167,13 +167,13 @@ class NineSliceSprite extends NodeWithSize with SpritePaint {
// Add a rectangle (two triangles).
int index = y * 4 + x;
_indicies.add(index);
_indicies.add(index + 1);
_indicies.add(index + 4);
_indices.add(index);
_indices.add(index + 1);
_indices.add(index + 4);
_indicies.add(index + 1);
_indicies.add(index + 5);
_indicies.add(index + 4);
_indices.add(index + 1);
_indices.add(index + 5);
_indices.add(index + 4);
}
}
}
......@@ -184,7 +184,7 @@ class NineSliceSprite extends NodeWithSize with SpritePaint {
_textureCoordinates,
_colors,
TransferMode.modulate,
_indicies,
_indices,
_cachedPaint
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment