scrollToIndex method
Scrolls to a specific index in the message list.
Implementation
Future<void> scrollToIndex(
int index, {
Duration duration = const Duration(milliseconds: 250),
Curve curve = Curves.linearToEaseOut,
/// Desired position of the message in viewport [0.0, 1.0].
/// 0 = top, 0.5 = middle, 1 = bottom
double alignment = 0,
double offset = 0,
}) {
if (_scrollToIndex == null) {
return Future.value();
}
return (_scrollToIndex as ScrollToIndex)(
index,
duration: duration,
curve: curve,
alignment: alignment,
offset: offset,
);
}