nearestBar method

int nearestBar(
  1. double now
)

Implementation

int nearestBar(double now) {
  double index = now / ref.watch(chartDataProvider).itemWidth;
  int left = index.round();
  return left;
}