selfprivacy.org.app/lib/utils/extensions/elevation_extension.dart
2021-12-06 18:31:19 +00:00

31 lines
905 B
Dart

library elevation_extension;
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
extension ElevationExtension on BoxDecoration {
BoxDecoration copyWith({
Color? color,
DecorationImage? image,
BoxBorder? border,
BorderRadiusGeometry? borderRadius,
List<BoxShadow>? boxShadow,
Gradient? gradient,
BlendMode? backgroundBlendMode,
BoxShape? shape,
}) {
return BoxDecoration(
color: color ?? this.color,
image: image ?? this.image,
border: border ?? this.border,
borderRadius: borderRadius ?? this.borderRadius,
boxShadow: this.boxShadow != null || boxShadow != null
? [...this.boxShadow ?? [], ...boxShadow ?? []]
: null,
gradient: gradient ?? this.gradient,
backgroundBlendMode: backgroundBlendMode ?? this.backgroundBlendMode,
shape: shape ?? this.shape,
);
}
}