buildChildLayout method

  1. @override
Widget buildChildLayout(
  1. BuildContext context
)
override

Subclasses should override this method to build the layout model.

Implementation

@override
Widget buildChildLayout(BuildContext context) {
  Widget result;
  if (itemExtent != null) {
    result = SliverFixedExtentList(
      delegate: childrenDelegate,
      itemExtent: itemExtent!,
    );
  } else {
    result = SliverList(delegate: childrenDelegate);
  }

  var theme;
  if (this.theme != null) {
    theme = this.theme;
  } else if (scrollDirection != TimelineTheme.of(context).direction) {
    theme = TimelineTheme.of(context).copyWith(direction: scrollDirection);
  }

  if (theme != null) {
    return TimelineTheme(
      data: theme,
      child: result,
    );
  } else {
    return result;
  }
}