part of main;

class MainController extends GetxController {
  late final PageController pageController;

  // 默认显示
  int currentPage = 1;

  @override
  void onInit() {
    super.onInit();
    pageController = PageController(initialPage: currentPage);
  }

  @override
  void onClose() {
    pageController.dispose();
    super.onClose();
  }

  /// 页码变化
  void onPageChanged(int page) {
    currentPage = page;
    update(['navigation']);
  }
}
