TimelineTileBuilder.connectedFromStyle constructor
TimelineTileBuilder.connectedFromStyle({
- @required required int itemCount,
- ConnectionDirection connectionDirection = ConnectionDirection.after,
- NullableIndexedWidgetBuilder? contentsBuilder,
- NullableIndexedWidgetBuilder? oppositeContentsBuilder,
- ContentsAlign contentsAlign = ContentsAlign.basic,
- IndexedValueBuilder<
IndicatorStyle> ? indicatorStyleBuilder, - IndexedValueBuilder<
ConnectorStyle> ? connectorStyleBuilder, - ConnectorStyle firstConnectorStyle = ConnectorStyle.solidLine,
- ConnectorStyle lastConnectorStyle = ConnectorStyle.solidLine,
- double? itemExtent,
- IndexedValueBuilder<
double> ? itemExtentBuilder, - IndexedValueBuilder<
double> ? nodePositionBuilder, - IndexedValueBuilder<
double> ? indicatorPositionBuilder,
Create a connected tile builder, which builds tiles using each style.
If each item has a fixed extent, use itemExtent
, and if each item has a
different extent, use itemExtentBuilder
.
See also:
- TimelineTileBuilder.connected, which builds connected tiles.
- TimelineTileBuilder.fromStyle, which builds tiles from style.
Implementation
factory TimelineTileBuilder.connectedFromStyle({
@required required int itemCount,
ConnectionDirection connectionDirection = ConnectionDirection.after,
NullableIndexedWidgetBuilder? contentsBuilder,
NullableIndexedWidgetBuilder? oppositeContentsBuilder,
ContentsAlign contentsAlign = ContentsAlign.basic,
IndexedValueBuilder<IndicatorStyle>? indicatorStyleBuilder,
IndexedValueBuilder<ConnectorStyle>? connectorStyleBuilder,
ConnectorStyle firstConnectorStyle = ConnectorStyle.solidLine,
ConnectorStyle lastConnectorStyle = ConnectorStyle.solidLine,
double? itemExtent,
IndexedValueBuilder<double>? itemExtentBuilder,
IndexedValueBuilder<double>? nodePositionBuilder,
IndexedValueBuilder<double>? indicatorPositionBuilder,
}) {
return TimelineTileBuilder(
itemCount: itemCount,
contentsAlign: contentsAlign,
contentsBuilder: contentsBuilder,
oppositeContentsBuilder: oppositeContentsBuilder,
indicatorBuilder: (context, index) => _createStyledIndicatorBuilder(
indicatorStyleBuilder?.call(context, index))(context),
startConnectorBuilder: _createConnectedStartConnectorBuilder(
connectionDirection: connectionDirection,
firstConnectorBuilder: (context) =>
_createStyledConnectorBuilder(firstConnectorStyle)(context),
connectorBuilder: (context, index, __) => _createStyledConnectorBuilder(
connectorStyleBuilder?.call(context, index))(context),
),
endConnectorBuilder: _createConnectedEndConnectorBuilder(
connectionDirection: connectionDirection,
lastConnectorBuilder: (context) =>
_createStyledConnectorBuilder(lastConnectorStyle)(context),
connectorBuilder: (context, index, __) => _createStyledConnectorBuilder(
connectorStyleBuilder?.call(context, index))(context),
itemCount: itemCount,
),
itemExtent: itemExtent,
itemExtentBuilder: itemExtentBuilder,
nodePositionBuilder: nodePositionBuilder,
indicatorPositionBuilder: indicatorPositionBuilder,
);
}