Beispiel #1
0
 public bool Equals(CardTheme other)
 {
     return(other.clipBehavior == this.clipBehavior &&
            other.color == this.color &&
            other.elevation == this.elevation &&
            other.margin == this.margin &&
            other.shape == this.shape);
 }
Beispiel #2
0
 public bool Equals(CardTheme other)
 {
     return(other.clipBehavior == clipBehavior &&
            other.color == color &&
            other.shadowColor == shadowColor &&
            other.elevation == elevation &&
            other.margin == margin &&
            other.shape == shape);
 }
Beispiel #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)
                ));
 }
Beispiel #4
0
        public override Widget build(BuildContext context)
        {
            CardTheme cardTheme = CardTheme.of(context);

            return(new Container(
                       margin: this.margin ?? cardTheme.margin ?? EdgeInsets.all(4.0f),
                       child: new Material(
                           type: MaterialType.card,
                           color: this.color ?? cardTheme.color ?? Theme.of(context).cardColor,
                           elevation: this.elevation ?? cardTheme.elevation ?? _defaultElevation,
                           shape: this.shape ?? cardTheme.shape ?? new RoundedRectangleBorder(
                               borderRadius: BorderRadius.all(Radius.circular(4.0f))
                               ),
                           borderOnForeground: this.borderOnForeground,
                           clipBehavior: this.clipBehavior ?? cardTheme.clipBehavior ?? _defaultClipBehavior,
                           child: this.child)
                       ));
        }