WidgetSlider class

A simple carousel type component-slider widget for Flutter.

Example:

WidgetSlider(
  fixedSize: 300,
  itemCount: images.length,
  itemBuilder: (context, index, isActive) {
    return Container(
      decoration: const BoxDecoration(
        image: DecorationImage(
          image: NetworkImage('https://picsum.photos/200/300')
        ),
      ),
    );
),
Inheritance

Constructors

WidgetSlider({Key? key, required int itemCount, required Widget itemBuilder(BuildContext, int, int), dynamic onMove(int i)?, SliderController? controller, double proximity = .5, double? sizeDistinction = 0.5, Axis scrollDirection = Axis.horizontal, double aspectRatio = 2, double? fixedSize, Curve transformCurve = Curves.easeOut, bool reverse = false, bool pageSnapping = true, bool infiniteScroll = false, ScrollPhysics? physics, bool padEnds = true})
const

Properties

aspectRatio → double
Ratio is of whole list widget.
final
controller → SliderController?
A external controller to manipulate widget from outside of it.
final
fixedSize → double?
Concrete fixed size for whole list widget.
final
hashCode → int
The hash code for this object.
no setterinherited
infiniteScroll → bool
TODO: implement functionality to the widget.
final
itemBuilder → Widget Function(BuildContext, int, int)
Widget generator of the list. Generated widgets are represented as PageView pages.
final
itemCount → int
Length of items that'd be built via itemBuilder.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onMove → dynamic Function(int i)?
A function to execute on each page move. {i} represents the index of moved page.
final
padEnds → bool
Whether to add padding to both ends of the list.
final
pageSnapping → bool
Enables/Disables snapping physics animation of widget.
final
physics → ScrollPhysics?
Physics of the list widget. The physics are modified to snap to page boundaries using PageScrollPhysics prior to being used.
final
proximity → double
The proximity between items. Value should be given as basic representation of percentages from (0 to 1) as | 0.1 -> 10% | 0.2 -> 20% ...
final
reverse → bool
Reverse initializes list as reversed. 1, 2, 3 --> 3, 2, 1 (But remains at same page index(0)).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollDirection → Axis
The scroll direction of list widget.
final
sizeDistinction → double?
Decides differences of active & non-active item sizes . Value should be given as basic representation of percentages from (0 to 1) as | 0.1 -> 10% | 0.2 -> 20% ...
final
transformCurve → Curve
Animation curve style of widget's distinction.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited