feat: live dm block

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-19 18:46:01 +08:00
parent dcb893ed07
commit 0bc0c36f14
14 changed files with 760 additions and 19 deletions

View File

@@ -11,7 +11,7 @@ class CustomSliverPersistentHeaderDelegate
final double _minExtent;
final double _maxExtent;
final Widget child;
final Color bgColor;
final Color? bgColor;
@override
Widget build(
@@ -19,18 +19,20 @@ class CustomSliverPersistentHeaderDelegate
//创建child子组件
//shrinkOffsetchild偏移值minExtent~maxExtent
//overlapsContentSliverPersistentHeader覆盖其他子组件返回true否则返回false
return DecoratedBox(
decoration: BoxDecoration(
color: bgColor,
boxShadow: [
BoxShadow(
color: bgColor,
offset: const Offset(0, -2),
),
],
),
child: child,
);
return bgColor != null
? DecoratedBox(
decoration: BoxDecoration(
color: bgColor,
boxShadow: [
BoxShadow(
color: bgColor!,
offset: const Offset(0, -2),
),
],
),
child: child,
)
: child;
}
//SliverPersistentHeader最大高度