コード例 #1
0
        public static ChipThemeData lerp(ChipThemeData a, ChipThemeData b, float t)
        {
            if (a == null && b == null)
            {
                return(null);
            }

            return(new ChipThemeData(
                       backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
                       deleteIconColor: Color.lerp(a?.deleteIconColor, b?.deleteIconColor, t),
                       disabledColor: Color.lerp(a?.disabledColor, b?.disabledColor, t),
                       selectedColor: Color.lerp(a?.selectedColor, b?.selectedColor, t),
                       secondarySelectedColor: Color.lerp(a?.secondarySelectedColor, b?.secondarySelectedColor, t),
                       shadowColor: Color.lerp(a?.shadowColor, b?.shadowColor, t),
                       selectedShadowColor: Color.lerp(a?.selectedShadowColor, b?.selectedShadowColor, t),
                       labelPadding: EdgeInsets.lerp(a?.labelPadding, b?.labelPadding, t),
                       padding: EdgeInsets.lerp(a?.padding, b?.padding, t),
                       shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
                       labelStyle: TextStyle.lerp(a?.labelStyle, b?.labelStyle, t),
                       secondaryLabelStyle: TextStyle.lerp(a?.secondaryLabelStyle, b?.secondaryLabelStyle, t),
                       brightness: t < 0.5f ? a?.brightness ?? Brightness.light : b?.brightness ?? Brightness.light,
                       elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
                       pressElevation: MathUtils.lerpFloat(a?.pressElevation ?? 0.0f, b?.pressElevation ?? 0.0f, t)
                       ));
        }
コード例 #2
0
 public static CardTheme lerp(CardTheme a, CardTheme b, float t)
 {
     return(new CardTheme(
                clipBehavior: t < 0.5f ? a?.clipBehavior : b?.clipBehavior,
                color: Color.lerp(a?.color, b?.color, t),
                elevation: MathUtils.lerpFloat(a?.elevation ?? 0.0f, b?.elevation ?? 0.0f, t),
                margin: EdgeInsets.lerp(a?.margin, b?.margin, t),
                shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
                ));
 }
コード例 #3
0
ファイル: tab_indicator.cs プロジェクト: JC-ut0/CubeGame
        public override Decoration lerpTo(Decoration b, float t)
        {
            if (b is UnderlineTabIndicator)
            {
                UnderlineTabIndicator _b = (UnderlineTabIndicator)b;
                return(new UnderlineTabIndicator(
                           borderSide: BorderSide.lerp(this.borderSide, _b.borderSide, t),
                           insets: EdgeInsets.lerp(this.insets, _b.insets, t)
                           ));
            }

            return(base.lerpTo(b, t));
        }
コード例 #4
0
ファイル: tab_indicator.cs プロジェクト: JC-ut0/CubeGame
        public override Decoration lerpFrom(Decoration a, float t)
        {
            if (a is UnderlineTabIndicator)
            {
                UnderlineTabIndicator _a = (UnderlineTabIndicator)a;
                return(new UnderlineTabIndicator(
                           borderSide: BorderSide.lerp(_a.borderSide, this.borderSide, t),
                           insets: EdgeInsets.lerp(_a.insets, this.insets, t)
                           ));
            }

            return(base.lerpFrom(a, t));
        }
コード例 #5
0
 public static TabBarTheme lerp(TabBarTheme a, TabBarTheme b, float t)
 {
     D.assert(a != null);
     D.assert(b != null);
     return(new TabBarTheme(
                indicator: Decoration.lerp(a.indicator, b.indicator, t),
                indicatorSize: t < 0.5 ? a.indicatorSize : b.indicatorSize,
                labelColor: Color.lerp(a.labelColor, b.labelColor, t),
                labelPadding: EdgeInsets.lerp(a.labelPadding, b.labelPadding, t),
                labelStyle: TextStyle.lerp(a.labelStyle, b.labelStyle, t),
                unselectedLabelColor: Color.lerp(a.unselectedLabelColor, b.unselectedLabelColor, t),
                unselectedLabelStyle: TextStyle.lerp(a.unselectedLabelStyle, b.unselectedLabelStyle, t)
                ));
 }