I wanted to add shadow to a box inside BoxDecoration
only on top side. Is it possible in flutter ? This is my approach so far but not getting the desired results. Thanks in advannce.
class SectionHeaderDelegate extends SliverPersistentHeaderDelegate {
final String title;
final double height;
SectionHeaderDelegate(this.title, [this.height = 50]);
@override
Widget build(context, double shrinkOffset, bool overlapsContent) {
return Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 5 * SizeConfig.widthMultiplier),
decoration: BoxDecoration(
color: AppColors.colorWhite,
borderRadius: BorderRadius.only(
topRight: Radius.circular(30), topLeft: Radius.circular(30)),
boxShadow: <BoxShadow>[
BoxShadow(
color: AppColors.colorLightGrey,
blurRadius: 20.0,
offset: Offset(0.0, 1.0))
],
),
child: Text(title, style: AppStyles.complaints),
);
}
@override
double get maxExtent => height;
@override
double get minExtent => height;
@override
bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) => false;
}```
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…