LiquidSwipe constructor

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

Constructor for LiquidSwipe for predefined pages Required List of Widgets like Container/SizedBox

sample page :

    Container(
     color: Colors.pink,
     child: Column(
      crossAxisAlignment: CrossAxisAlignment.center,
      mainAxisSize: MainAxisSize.max,
      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
      children: <Widget>[
        Image.asset(
          'assets/1.png',
          fit: BoxFit.cover,
        ),
        Padding(
          padding: EdgeInsets.all(20.0),
        ),
        Column(
          children: <Widget>[
            Text(
              "Hi",
              style: MyApp.style,
            ),
            Text(
              "It's Me",
              style: MyApp.style,
            ),
            Text(
              "Sahdeep",
              style: MyApp.style,
            ),
          ],
        ),
      ],
    ),
  ),

You can just create a list using this type of widgets

Implementation

LiquidSwipe({
  Key? key,
  required List<Widget> pages,
  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.preferDragFromRevealedArea = false,
  this.ignoreUserGestureWhileAnimating = false,
  this.disableUserGesture = false,
  this.enableSideReveal = false,
})  : assert(initialPage >= 0 && initialPage < pages.length),
      assert(positionSlideIcon >= 0 && positionSlideIcon <= 1),
      liquidSwipeChildDelegate = LiquidSwipePagesChildDelegate(pages),
      super(key: key);