2020-11-30 10:03:55 +00:00
|
|
|
library elevation_extension;
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
|
|
|
extension ElevationExtension on BoxDecoration {
|
|
|
|
BoxDecoration copyWith({
|
2022-06-05 19:36:32 +00:00
|
|
|
final Color? color,
|
|
|
|
final DecorationImage? image,
|
|
|
|
final BoxBorder? border,
|
|
|
|
final BorderRadiusGeometry? borderRadius,
|
|
|
|
final List<BoxShadow>? boxShadow,
|
|
|
|
final Gradient? gradient,
|
|
|
|
final BlendMode? backgroundBlendMode,
|
|
|
|
final BoxShape? shape,
|
2022-06-05 22:40:34 +00:00
|
|
|
}) =>
|
|
|
|
BoxDecoration(
|
|
|
|
color: color ?? this.color,
|
|
|
|
image: image ?? this.image,
|
|
|
|
border: border ?? this.border,
|
|
|
|
borderRadius: borderRadius ?? this.borderRadius,
|
|
|
|
boxShadow: this.boxShadow != null || boxShadow != null
|
|
|
|
? <BoxShadow>[
|
|
|
|
...this.boxShadow ?? <BoxShadow>[],
|
|
|
|
...boxShadow ?? <BoxShadow>[]
|
|
|
|
]
|
|
|
|
: null,
|
|
|
|
gradient: gradient ?? this.gradient,
|
|
|
|
backgroundBlendMode: backgroundBlendMode ?? this.backgroundBlendMode,
|
|
|
|
shape: shape ?? this.shape,
|
|
|
|
);
|
2020-11-30 10:03:55 +00:00
|
|
|
}
|