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)
                       ));
        }
Exemple #2
0
 public static DialogTheme lerp(DialogTheme a, DialogTheme b, float t)
 {
     return(new DialogTheme(
                backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
                elevation: MathUtils.lerpNullableFloat(a?.elevation, b?.elevation, t),
                shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
                titleTextStyle: TextStyle.lerp(a?.titleTextStyle, b?.titleTextStyle, t),
                contentTextStyle: TextStyle.lerp(a?.contentTextStyle, b?.contentTextStyle, t)
                ));
 }
Exemple #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),
                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)
                ));
 }
Exemple #4
0
 public static SnackBarThemeData lerp(SnackBarThemeData a, SnackBarThemeData b, float t)
 {
     return(new SnackBarThemeData(
                backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
                actionTextColor: Color.lerp(a?.actionTextColor, b?.actionTextColor, t),
                disabledActionTextColor: Color.lerp(a?.disabledActionTextColor, b?.disabledActionTextColor, t),
                contentTextStyle: TextStyle.lerp(a?.contentTextStyle, b?.contentTextStyle, t),
                elevation: MathUtils.lerpNullableFloat(a?.elevation, b?.elevation, t),
                shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
                behavior: t < 0.5 ? a.behavior : b.behavior
                ));
 }
Exemple #5
0
 public static PopupMenuThemeData lerp(PopupMenuThemeData a, PopupMenuThemeData b, float t)
 {
     if (a == null && b == null)
     {
         return(null);
     }
     return(new PopupMenuThemeData(
                color: Color.lerp(a?.color, b?.color, t),
                shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
                elevation: MathUtils.lerpNullableFloat(a?.elevation, b?.elevation, t),
                textStyle: TextStyle.lerp(a?.textStyle, b?.textStyle, t)
                ));
 }
Exemple #6
0
 public static BottomSheetThemeData lerp(BottomSheetThemeData a, BottomSheetThemeData b, float t)
 {
     if (a == null && b == null)
     {
         return(null);
     }
     return(new BottomSheetThemeData(
                backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
                elevation: MathUtils.lerpNullableFloat(a?.elevation, b?.elevation, t),
                modalBackgroundColor: Color.lerp(a?.modalBackgroundColor, b?.modalBackgroundColor, t),
                modalElevation: MathUtils.lerpNullableFloat(a?.modalElevation, b?.modalElevation, t),
                shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
                clipBehavior: t < 0.5 ? a?.clipBehavior : b?.clipBehavior
                ));
 }
        public static FloatingActionButtonThemeData lerp(FloatingActionButtonThemeData a, FloatingActionButtonThemeData b,
                                                         float t)
        {
            if (a == null && b == null)
            {
                return(null);
            }

            return(new FloatingActionButtonThemeData(
                       backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
                       foregroundColor: Color.lerp(a?.foregroundColor, b?.foregroundColor, t),
                       elevation: MathUtils.lerpFloat(a?.elevation ?? 0, b?.elevation ?? 0, t),
                       disabledElevation: MathUtils.lerpFloat(a?.disabledElevation ?? 0, b?.disabledElevation ?? 0, t),
                       highlightElevation: MathUtils.lerpFloat(a?.highlightElevation ?? 0, b?.highlightElevation ?? 0, t),
                       shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
                       ));
        }
 public static DialogTheme lerp(DialogTheme a, DialogTheme b, float t)
 {
     return(new DialogTheme(
                shape: ShapeBorder.lerp(a?.shape, b?.shape, t)
                ));
 }