2020-11-30 10:03:55 +00:00
|
|
|
library elevation_extension;
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:selfprivacy/config/brand_shadow.dart';
|
|
|
|
|
|
|
|
extension ElevationExtension on BoxDecoration {
|
|
|
|
BoxDecoration get ev8 => copyWith(boxShadow: [shadow8]);
|
|
|
|
|
|
|
|
BoxDecoration copyWith({
|
2021-03-15 15:39:44 +00:00
|
|
|
Color? color,
|
|
|
|
DecorationImage? image,
|
|
|
|
BoxBorder? border,
|
|
|
|
BorderRadiusGeometry? borderRadius,
|
|
|
|
List<BoxShadow>? boxShadow,
|
|
|
|
Gradient? gradient,
|
|
|
|
BlendMode? backgroundBlendMode,
|
|
|
|
BoxShape? shape,
|
2020-11-30 10:03:55 +00:00
|
|
|
}) {
|
|
|
|
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,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|