TimelineTileBuilder.connectedFromStyle constructor

TimelineTileBuilder.connectedFromStyle({
  1. @required required int itemCount,
  2. ConnectionDirection connectionDirection = ConnectionDirection.after,
  3. NullableIndexedWidgetBuilder? contentsBuilder,
  4. NullableIndexedWidgetBuilder? oppositeContentsBuilder,
  5. ContentsAlign contentsAlign = ContentsAlign.basic,
  6. IndexedValueBuilder<IndicatorStyle>? indicatorStyleBuilder,
  7. IndexedValueBuilder<ConnectorStyle>? connectorStyleBuilder,
  8. ConnectorStyle firstConnectorStyle = ConnectorStyle.solidLine,
  9. ConnectorStyle lastConnectorStyle = ConnectorStyle.solidLine,
  10. double? itemExtent,
  11. IndexedValueBuilder<double>? itemExtentBuilder,
  12. IndexedValueBuilder<double>? nodePositionBuilder,
  13. 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:

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,
  );
}