Beispiel #1
0
        public static ToggleButtonsThemeData lerp(ToggleButtonsThemeData a, ToggleButtonsThemeData b, float t)
        {
            if (a == null && b == null)
            {
                return(null);
            }

            return(new ToggleButtonsThemeData(
                       textStyle: TextStyle.lerp(a?.textStyle, b?.textStyle, t),
                       constraints: BoxConstraints.lerp(a?.constraints, b?.constraints, t),
                       color: Color.lerp(a?.color, b?.color, t),
                       selectedColor: Color.lerp(a?.selectedColor, b?.selectedColor, t),
                       disabledColor: Color.lerp(a?.disabledColor, b?.disabledColor, t),
                       fillColor: Color.lerp(a?.fillColor, b?.fillColor, t),
                       focusColor: Color.lerp(a?.focusColor, b?.focusColor, t),
                       highlightColor: Color.lerp(a?.highlightColor, b?.highlightColor, t),
                       hoverColor: Color.lerp(a?.hoverColor, b?.hoverColor, t),
                       splashColor: Color.lerp(a?.splashColor, b?.splashColor, t),
                       borderColor: Color.lerp(a?.borderColor, b?.borderColor, t),
                       selectedBorderColor: Color.lerp(a?.selectedBorderColor, b?.selectedBorderColor, t),
                       disabledBorderColor: Color.lerp(a?.disabledBorderColor, b?.disabledBorderColor, t),
                       borderRadius: BorderRadius.lerp(a?.borderRadius, b?.borderRadius, t),
                       borderWidth: MathUtils.lerpNullableFloat(a?.borderWidth, b?.borderWidth, t)
                       ));
        }
        public override ShapeBorder lerpTo(ShapeBorder b, float t) {
            if (b is UnderlineInputBorder) {
                return new UnderlineInputBorder(
                    borderSide: BorderSide.lerp(this.borderSide, (b as UnderlineInputBorder).borderSide, t),
                    borderRadius: BorderRadius.lerp(this.borderRadius, (b as UnderlineInputBorder).borderRadius, t)
                );
            }

            return base.lerpTo(b, t);
        }
        public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
            if (a is UnderlineInputBorder) {
                return new UnderlineInputBorder(
                    borderSide: BorderSide.lerp((a as UnderlineInputBorder).borderSide, this.borderSide, t),
                    borderRadius: BorderRadius.lerp((a as UnderlineInputBorder).borderRadius, this.borderRadius, t)
                );
            }

            return base.lerpFrom(a, t);
        }
        public override ShapeBorder lerpTo(ShapeBorder b, float t) {
            if (b is OutlineInputBorder) {
                OutlineInputBorder outline = b as OutlineInputBorder;
                return new OutlineInputBorder(
                    borderRadius: BorderRadius.lerp(this.borderRadius, outline.borderRadius, t),
                    borderSide: BorderSide.lerp(this.borderSide, outline.borderSide, t),
                    gapPadding: outline.gapPadding
                );
            }

            return base.lerpTo(b, t);
        }
        public override ShapeBorder lerpFrom(ShapeBorder a, float t) {
            if (a is OutlineInputBorder) {
                OutlineInputBorder outline = a as OutlineInputBorder;
                return new OutlineInputBorder(
                    borderRadius: BorderRadius.lerp(outline.borderRadius, this.borderRadius, t),
                    borderSide: BorderSide.lerp(outline.borderSide, this.borderSide, t),
                    gapPadding: outline.gapPadding
                );
            }

            return base.lerpFrom(a, t);
        }
Beispiel #6
0
 public override ShapeBorder lerpTo(ShapeBorder b, float t)
 {
     if (b is CutCornersBorder)
     {
         CutCornersBorder outline = (CutCornersBorder)b;
         return(new CutCornersBorder(
                    borderRadius: BorderRadius.lerp(borderRadius, outline.borderRadius, t),
                    borderSide: BorderSide.lerp(borderSide, outline.borderSide, t),
                    cut: cut,
                    gapPadding: outline.gapPadding
                    ));
     }
     return(base.lerpTo(b, t));
 }
Beispiel #7
0
 public override ShapeBorder lerpFrom(ShapeBorder a, float t)
 {
     if (a is CutCornersBorder)
     {
         CutCornersBorder outline = (CutCornersBorder)a;
         return(new CutCornersBorder(
                    borderRadius: BorderRadius.lerp(outline.borderRadius, borderRadius, t),
                    borderSide: BorderSide.lerp(outline.borderSide, borderSide, t),
                    cut: cut,
                    gapPadding: outline.gapPadding
                    ));
     }
     return(base.lerpFrom(a, t));
 }