mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
Update adaptable_page_view.dart (#2134)
Co-authored-by: Matthew Fosse <matt@fosse.co>
This commit is contained in:
parent
b1e5d1503e
commit
869c5a83cf
1 changed files with 18 additions and 3 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue