onInit method

  1. @override
void onInit(
  1. BuildContext context,
  2. TabLayoutController controller
)
override

Implementation

@override
void onInit(BuildContext context, TabLayoutController controller) {
  super.onInit(context, controller);
  final tc = tabController;
  controller.currentIndex = tc.index;
  final anim = tc.animation;
  if (anim != null) {
    anim.addListener(() => controller.setPage(anim.value));
  }
}