TF-4075 Jump to attachments list position on mobile
(cherry picked from commit cd2ca1ec3c5b5160820823905d9f0183536b07e3)
This commit is contained in:
@@ -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 (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user