mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-25 05:58:42 +01:00
Update adaptable_page_view.dart (#2134)
Co-authored-by: Matthew Fosse <matt@fosse.co>
This commit is contained in:
@@ -137,10 +137,25 @@ class _RenderSizingContainer extends RenderProxyBox {
|
||||
parentUsesSize: true,
|
||||
);
|
||||
|
||||
final a = sizes[page.floor()]!;
|
||||
final b = sizes[page.ceil()]!;
|
||||
final int floorPage = page.floor();
|
||||
final int ceilPage = page.ceil();
|
||||
|
||||
Size? a = sizes[floorPage];
|
||||
Size? b = sizes[ceilPage];
|
||||
|
||||
if (a == null && sizes.isNotEmpty) {
|
||||
a = sizes.values.first;
|
||||
}
|
||||
if (b == null && sizes.isNotEmpty) {
|
||||
b = sizes.values.first;
|
||||
}
|
||||
|
||||
a ??= child.getDryLayout(constraints);
|
||||
b ??= a;
|
||||
|
||||
final double t = (page - floorPage).clamp(0.0, 1.0);
|
||||
final double height = lerpDouble(a.height, b.height, t) ?? a.height;
|
||||
|
||||
final height = lerpDouble(a.height, b.height, page - page.floor());
|
||||
|
||||
child.layout(
|
||||
constraints.copyWith(minHeight: height, maxHeight: height),
|
||||
|
||||
Reference in New Issue
Block a user