You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect implementation of ScrollMetrics.extentInside getter #31430
import 'package:flutter/widgets.dart';
import 'package:test/test.dart';
void main() {
test('Expect correct extent metrics when max scroll extent is less than viewport dimension', () {
// Given
ScrollMetrics metrics = FixedScrollMetrics(
axisDirection: AxisDirection.down,
// User scrolled 1 pixel
pixels: 1,
// Viewport is 100
viewportDimension: 100,
minScrollExtent: 0,
// User can scroll max 10 pixels
maxScrollExtent: 10,
);
// Extent before is 1, which is correct
expect(metrics.extentBefore, 1);
// Extent inside fails here.
// According to documentation
// extentInside should be viewport height
// as extentBefore and extentAfter are non-zero
// But it is 10, not 100
expect(metrics.extentInside, 100);
// Extent after is 9, which is correct
expect(metrics.extentAfter, 9);
});
}
On UI it will cause scroll thumb to be always half height of the viewport in cases when there is no too much to scroll.
In those cases scroll thumb should be close to viewport height.
[✓] Flutter (Channel stable, v1.2.1, on Linux, locale en_US.UTF-8)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
github-actions commentedon Aug 29, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.