jumpToPage method

void jumpToPage(
  1. int page
)

Implementation

void jumpToPage(int page) {
  if (quranPagesController.hasClients) {
    // استخدام animateToPage بدلاً من jumpToPage للحصول على انتقال أكثر سلاسة
    // Use animateToPage instead of jumpToPage for smoother transition
    quranPagesController.animateToPage(
      page,
      duration: const Duration(milliseconds: 300),
      curve: Curves.easeInOut,
    );
  } else {
    quranPagesController = PageController(
      initialPage: page,
      keepPage: true,
      viewportFraction: 1.0,
    );
  }
}