Esempio n. 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),
                       checkmarkColor: Color.lerp(a?.checkmarkColor, b?.checkmarkColor, t),
                       labelPadding: EdgeInsetsGeometry.lerp(a?.labelPadding, b?.labelPadding, t),
                       padding: EdgeInsetsGeometry.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.lerpNullableFloat(a?.elevation, b?.elevation, t),
                       pressElevation: MathUtils.lerpNullableFloat(a?.pressElevation, b?.pressElevation, t)
                       ));
        }
Esempio n. 2
0
 public static MaterialBannerThemeData lerp(MaterialBannerThemeData a, MaterialBannerThemeData b, float t)
 {
     return(new MaterialBannerThemeData(
                backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
                contentTextStyle: TextStyle.lerp(a?.contentTextStyle, b?.contentTextStyle, t),
                padding: EdgeInsetsGeometry.lerp(a?.padding, b?.padding, t),
                leadingPadding: EdgeInsetsGeometry.lerp(a?.leadingPadding, b?.leadingPadding, t)
                ));
 }
Esempio n. 3
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),
                shadowColor: Color.lerp(a?.shadowColor, b?.shadowColor, t),
                elevation: MathUtils.lerpNullableFloat(a?.elevation, b?.elevation, t),
                margin: EdgeInsetsGeometry.lerp(a?.margin, b?.margin, t),
                shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
                ));
 }
Esempio n. 4
0
        public override Decoration lerpTo(Decoration b, float t)
        {
            if (b is UnderlineTabIndicator)
            {
                UnderlineTabIndicator _b = (UnderlineTabIndicator)b;
                return(new UnderlineTabIndicator(
                           borderSide: BorderSide.lerp(borderSide, _b.borderSide, t),
                           insets: EdgeInsetsGeometry.lerp(insets, _b.insets, t)
                           ));
            }

            return(base.lerpTo(b, t));
        }
Esempio n. 5
0
        public override Decoration lerpFrom(Decoration a, float t)
        {
            if (a is UnderlineTabIndicator)
            {
                UnderlineTabIndicator _a = (UnderlineTabIndicator)a;
                return(new UnderlineTabIndicator(
                           borderSide: BorderSide.lerp(_a.borderSide, borderSide, t),
                           insets: EdgeInsetsGeometry.lerp(_a.insets, insets, t)
                           ));
            }

            return(base.lerpFrom(a, t));
        }
Esempio n. 6
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: EdgeInsetsGeometry.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)
                ));
 }
Esempio n. 7
0
 public static ButtonBarThemeData lerp(ButtonBarThemeData a, ButtonBarThemeData b, float t)
 {
     if (a == null && b == null)
     {
         return(null);
     }
     return(new ButtonBarThemeData(
                alignment: t < 0.5 ? a.alignment : b.alignment,
                mainAxisSize: t < 0.5 ? a.mainAxisSize : b.mainAxisSize,
                buttonTextTheme: t < 0.5 ? a.buttonTextTheme : b.buttonTextTheme,
                buttonMinWidth: MathUtils.lerpNullableFloat(a?.buttonMinWidth, b?.buttonMinWidth, t),
                buttonHeight: MathUtils.lerpNullableFloat(a?.buttonHeight, b?.buttonHeight, t),
                buttonPadding: EdgeInsetsGeometry.lerp(a?.buttonPadding, b?.buttonPadding, t),
                buttonAlignedDropdown: t < 0.5 ? a.buttonAlignedDropdown : b.buttonAlignedDropdown,
                layoutBehavior: t < 0.5 ? a.layoutBehavior : b.layoutBehavior,
                overflowDirection: t < 0.5 ? a.overflowDirection : b.overflowDirection
                ));
 }
Esempio n. 8
0
        public static TooltipThemeData lerp(TooltipThemeData a, TooltipThemeData b, float t)
        {
            if (a == null && b == null)
            {
                return(null);
            }

            return(new TooltipThemeData(
                       height: MathUtils.lerpNullableFloat(a?.height, b?.height, t),
                       padding: EdgeInsetsGeometry.lerp(a?.padding, b?.padding, t),
                       margin: EdgeInsetsGeometry.lerp(a?.margin, b?.margin, t),
                       verticalOffset: MathUtils.lerpNullableFloat(a?.verticalOffset, b?.verticalOffset, t),
                       preferBelow: t < 0.5f ? a.preferBelow: b.preferBelow,
                       excludeFromSemantics: t < 0.5f ? a.excludeFromSemantics : b.excludeFromSemantics,
                       decoration: Decoration.lerp(a?.decoration, b?.decoration, t),
                       textStyle: TextStyle.lerp(a?.textStyle, b?.textStyle, t)
                       ));
        }