Beispiel #1
0
        BorderRadius _borderRadius(int index, bool start, bool end)
        {
            D.assert(MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft ==
                     MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topRight);
            D.assert(MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft ==
                     MaterialConstantsUtils.kMaterialEdges[MaterialType.card].bottomLeft);
            D.assert(MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft ==
                     MaterialConstantsUtils.kMaterialEdges[MaterialType.card].bottomRight);

            Radius cardRadius  = MaterialConstantsUtils.kMaterialEdges[MaterialType.card].topLeft;
            Radius startRadius = Radius.zero;
            Radius endRadius   = Radius.zero;

            if (index > 0 && this._children[index - 1] is MaterialGap)
            {
                startRadius = Radius.lerp(
                    Radius.zero,
                    cardRadius,
                    this._animationTuples[this._children[index - 1].key].startAnimation.value);
            }

            if (index < this._children.Count - 2 && this._children[index + 1] is MaterialGap)
            {
                endRadius = Radius.lerp(
                    Radius.zero,
                    cardRadius,
                    this._animationTuples[this._children[index + 1].key].endAnimation.value);
            }

            if (this.widget.mainAxis == Axis.vertical)
            {
                return(BorderRadius.vertical(
                           top: start?cardRadius: startRadius,
                           bottom: end ? cardRadius : endRadius));
            }
            else
            {
                return(BorderRadius.horizontal(
                           left: start?cardRadius: startRadius,
                           right: end ? cardRadius : endRadius));
            }
        }