getTitleIndexWithWidgetIndex method

int getTitleIndexWithWidgetIndex(
  1. int index
)

get the index of MTitle

Implementation

int getTitleIndexWithWidgetIndex(int index) {
  final tocList = _tocList?.values.toList();
  if (tocList == null || tocList.isEmpty) return 0;
  if (tocList.length <= index) return tocList.length - 1;
  return tocList[index].index;
}