public override Widget build(BuildContext context, int index) { D.assert(builder != null); if (index < 0 || (childCount != null && index >= childCount)) { return(null); } Widget child = builder(context, index); if (child == null) { return(null); } Key key = child.key != null ? new _SaltedValueKey(child.key) : null; if (addRepaintBoundaries) { child = new RepaintBoundary(child: child); } if (addAutomaticKeepAlives) { child = new AutomaticKeepAlive(child: child); } return(new KeyedSubtree(child: child, key: key)); }
public override Widget build(BuildContext context, int index) { D.assert(children != null); if (index < 0 || index >= children.Count) { return(null); } Widget child = children[index]; D.assert( child != null, () => "The sliver's children must not contain null values, but a null value was found at index $index" ); Key key = child.key != null? new _SaltedValueKey(child.key) : null; if (addRepaintBoundaries) { child = new RepaintBoundary(child: child); } if (addAutomaticKeepAlives) { child = new AutomaticKeepAlive(child: child); } return(new KeyedSubtree(child: child, key: key)); }
public override Widget build(BuildContext context, int index) { D.assert(this.builder != null); if (index < 0 || (this.childCount != null && index >= this.childCount)) { return(null); } Widget child = this.builder(context, index); if (child == null) { return(null); } if (this.addRepaintBoundaries) { child = RepaintBoundary.wrap(child, index); } if (this.addAutomaticKeepAlives) { child = new AutomaticKeepAlive(child: child); } return(child); }