Pirooz Timeline is a customizable timeline. You can set your widget for indicator and the items,so you can create any timeline.
The name of library is Pirooz inspired of iranian cheetah cub.
To use Pirooz Timeline in your project, add the pirooz_timeline
to your pubspec.yaml
Import the package to use it:
import 'package:pirooz_timeline/pirooz_timeline.dart';
PiroozTimeline(flex: 5,
indicatorAlignment: IndicatorAlignment.top,
indicatorBuilder: (model, index) {},
connectorStyle: const ConnectorStyle(
color: Colors.amber,
dashSpace: 4,
dashHeight: 5,
),
models: const [],
widgetBuilder: (PiroozModel model, int index) {},
)
flex
: proportion of item and it's indicatorindicatorAlignment
: enum that contains threetop
,bottom
andcenter
alignment for indicator.indicatorBuilder
: a builder that gives you the model and index of the model, and you can create different indicators base on modelruntimeType
or index of it.physics
: scrolling physics. Default isNeverScrollableScrollPhysics
connectorStyle
: Style of vertical dashes contains following properties:color
: color of dashesdashSpace
: space between dashesdashHeight
: height of each dashwidth
: width of each dashshowLineBeforeFirst
: by default, showing dashes before first line has not good look for timeline. Dashes are seperated in two part, before indicator and after indicator. By setting this propertytrue
dash before indicator will be shownshowLineAfterLast
: by default, showing dashes after last line has not good look for timeline. Dashes are seperated in two part, before indicator and after indicator. By setting this propertytrue
dash after indicator will be shownpadding
: padding of connectors
models
: list of item's that should be displayed in timeline. Each model should be subtype ofPiroozModel
. If previous or next indicator of models should be ignored, it can be handled byignoreNext
andignorePrevious
parameter.widgetBuilder
: a builder that gives you the model and index of the model, and you can create different items base on modelruntimeType
or index of it.