feat(widget): add offset() to TableState (#10)

Co-authored-by: Aaron Rennow <arennow@outlook.com>
This commit is contained in:
Orhun Parmaksız 2023-02-18 04:11:34 +02:00 committed by GitHub
parent 7e31035114
commit 9b7a6ed85d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -352,6 +352,13 @@ impl TableState {
self.offset = 0;
}
}
/// Returns a copy of the receiver's scroll offset.
///
/// This is useful, for example, if you need to "synchronize" the scrolling of a `Table` and a `Paragraph`.
pub fn offset(&self) -> usize {
self.offset
}
}
impl<'a> StatefulWidget for Table<'a> {