onInit method

  1. @override
void onInit()
override

Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.

Implementation

@override
void onInit() {
  super.onInit();

  cardinit();
  //Bellekteki paylaşımları yükle
  if (cachedCardList != null) {
    cardList.value ??= [];
    cardList.value = cachedCardList;
    firstFetchProcces.value = true;
  }

  if (!firstFetchProcces.value && xfirstFetch.value!) {
    if (cardList.value == null) {
      fetchcards();
      firstFetchProcces.value = true;
    }
  }
  xscrollController.value!.addListener(() {
    if (xscrollController.value!.position.pixels >=
        xscrollController.value!.position.maxScrollExtent * 0.9) {
      fetchcards();
    }
  });
}