In this article, we are going to integrate VelocityX Swiper UI in flutter application. You can also check out flutter slider related articles.
To implement velocityx ui in our flutter app, we need to use velocity_x flutter package. This package provides various types of widgets like VxStepper, VxRating, VxAnimator, VxToast, VxSwiper, VxPlatform. In this flutter example, we are using VxSwiper widget to create slider effect with football player info cards.
VxSwiper widget has many different properties to customize UI. The most important property is items. Using this property, we can display our array data with swipe functionality. We can also set custom height of swiper UI using height property. If we want to swipe list in vertical direction then we need to set Axis.vertical to scrollDirection property otherwise value will be Axis.horizontal.
We can also add animation when ui is sliding using scrollPhysics property in VxSwiper widget. Here we use BouncingScrollPhysics widget to create bounce animation when ui is swiped. We can also decide items can be swiped infinitely or not using enableInfiniteScroll property.
UI can also be automatically slide using autoPlay property. We need to set duration using autoPlayInterval property to decide after which time UI is swiped automatically. We can also set this autoplay animation duration using autoPlayAnimationDuration property of VxSwiper widget.
If we give value true to reverse property then items will be swiped in reverse order. We can also display any page by default using initialPage property. We can also make scrolling effect faster by giving value true to isFastScrollingEnabled property. We can also detect when item is swiped using onPageChanged property.