wrapByAutoScroll function

Widget wrapByAutoScroll(
  1. int index,
  2. Widget child,
  3. AutoScrollController controller
)

wrap widget by AutoScrollTag that can use AutoScrollController to scrollToIndex

Implementation

Widget wrapByAutoScroll(
    int index, Widget child, AutoScrollController controller) {
  return AutoScrollTag(
    key: Key(index.toString()),
    controller: controller,
    index: index,
    child: child,
    highlightColor: Colors.black.withOpacity(0.1),
  );
}