LiquidSwipe.builder constructor

LiquidSwipe.builder({
  1. Key? key,
  2. required IndexedWidgetBuilder itemBuilder,
  3. required int itemCount,
  4. double fullTransitionValue = FULL_TRANSITION_PX,
  5. int initialPage = 0,
  6. Widget? slideIconWidget,
  7. double positionSlideIcon = 0.8,
  8. bool enableLoop = true,
  9. LiquidController? liquidController,
  10. WaveType waveType = WaveType.liquidReveal,
  11. OnPageChangeCallback? onPageChangeCallback,
  12. CurrentUpdateTypeCallback? currentUpdateTypeCallback,
  13. SlidePercentCallback? slidePercentCallback,
  14. bool ignoreUserGestureWhileAnimating = false,
  15. bool disableUserGesture = false,
  16. bool enableSideReveal = false,
})

A builder constructor with same fields but with itemBuilder Sample itembuilder :

          itemCount: data.length,
          itemBuilder: (context, index){
            return Container(
              color: data[index].color,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisSize: MainAxisSize.max,
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: <Widget>[
                  Image.asset(
                    data[index].image,
                    fit: BoxFit.cover,
                  ),
                  Padding(
                    padding: EdgeInsets.all(20.0),
                  ),
                  Column(
                    children: <Widget>[
                      Text(
                        data[index].text1,
                        style: WithPages.style,
                      ),
                      Text(
                        data[index].text2,
                        style: WithPages.style,
                      ),
                      Text(
                        data[index].text3,
                        style: WithPages.style,
                      ),
                    ],
                  ),
                ],
              ),
            );
          },

See Example for complete reference.

Implementation

LiquidSwipe.builder({
  Key? key,
  required IndexedWidgetBuilder itemBuilder,
  required int itemCount,
  this.fullTransitionValue = FULL_TRANSITION_PX,
  this.initialPage = 0,
  this.slideIconWidget,
  this.positionSlideIcon = 0.8,
  this.enableLoop = true,
  this.liquidController,
  this.waveType = WaveType.liquidReveal,
  this.onPageChangeCallback,
  this.currentUpdateTypeCallback,
  this.slidePercentCallback,
  this.ignoreUserGestureWhileAnimating = false,
  this.disableUserGesture = false,
  this.enableSideReveal = false,
})  : assert(itemCount > 0),
      assert(initialPage >= 0 && initialPage < itemCount),
      assert(positionSlideIcon >= 0 && positionSlideIcon <= 1),
      liquidSwipeChildDelegate =
          LiquidSwipeBuilderChildDelegate(itemBuilder, itemCount),
      super(key: key);