isScrolledToEnd static method
Returns true if the given SuperTextField is scrolled all the away to the
end of the viewport.
This inspection applies to both horizontal and vertical scrolling text fields.
By default, this method expects a single SuperTextField in the widget tree and
finds it byType. To specify one SuperTextField among many, pass a superTextFieldFinder.
Implementation
static bool isScrolledToEnd([Finder? superTextFieldFinder]) {
final maxScrollOffset = findDesktopScrollController(superTextFieldFinder)?.position.maxScrollExtent ??
findMobileScrollController(superTextFieldFinder)?.endScrollOffset;
assert(maxScrollOffset != null,
"Couldn't check if SuperTextField is scrolled to the end because no SuperTextField was found.");
return findScrollOffset(superTextFieldFinder) == maxScrollOffset;
}