0 purchases
traversal slider
traversal_slider #
The traversal_slider package is a Flutter widget that allows for the smooth and animated traversal of widgets in a circular rotation.
Usage #
In the pubspec.yaml of your flutter project, add the following dependency:
dependencies:
...
traversal_slider: ^1.0.2
copied to clipboard
In your library add the following import:
import 'package:traversal_slider/traversal_slider.dart';
copied to clipboard
For help getting started with Flutter, view the online documentation.
Example #
Multiple View Slider implementation
TraversalSliderWidget(
widgets: List.generate(
foodImages.length,
(index) => Image.asset(
foodImages[index],
fit: BoxFit.cover,
),
),
sliderType: SliderType.multipleViewSlider,
onIndexChanged: (value) {
currentIndex = value;
setState(() {});
},
),
copied to clipboard
Single View Slider implementation
TraversalSliderWidget(
widgets: List.generate(
foodImages.length,
(index) => Image.asset(
foodImages[index],
fit: BoxFit.cover,
),
),
sliderType: SliderType.singleViewSlider,
onIndexChanged: (value) {
currentIndex = value;
setState(() {});
},
),
copied to clipboard
Options #
Name
Description
Default
Return
widgets
For assign widgets list
[]
-
sliderType
For Different Slider Types
SliderType.singleViewSlider
-
onIndexChange
Trigger when widget animate/change
0
current widget index
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.