TF-4075 Jump to attachments list position on mobile

(cherry picked from commit cd2ca1ec3c5b5160820823905d9f0183536b07e3)
This commit is contained in:
dab246
2025-10-07 01:25:19 +07:00
committed by Dat H. Pham
parent 3478e2aabc
commit 7057648b28
12 changed files with 112 additions and 25 deletions
@@ -25,4 +25,18 @@ extension ScrollControllerExtension on ScrollController {
curve: Curves.easeInOut,
);
}
void scrollToBottomWithPadding({required double padding}) {
try {
final maxExtent = position.maxScrollExtent;
final targetOffset = (maxExtent - padding).clamp(0.0, maxExtent);
animateTo(
targetOffset,
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut,
);
} catch (_) {}
}
}