mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-20 16:18:39 +00:00
@@ -577,7 +577,8 @@ class UserInfoCard extends StatelessWidget {
|
|||||||
) {
|
) {
|
||||||
if (imgUrls.length == 1) {
|
if (imgUrls.length == 1) {
|
||||||
final img = imgUrls.first;
|
final img = imgUrls.first;
|
||||||
return _buildHeader(
|
final title = img.title;
|
||||||
|
Widget child = _buildHeader(
|
||||||
context,
|
context,
|
||||||
isLight,
|
isLight,
|
||||||
width,
|
width,
|
||||||
@@ -586,6 +587,20 @@ class UserInfoCard extends StatelessWidget {
|
|||||||
fullCover: img.fullCover,
|
fullCover: img.fullCover,
|
||||||
alignment: Alignment(0.0, img.dy),
|
alignment: Alignment(0.0, img.dy),
|
||||||
);
|
);
|
||||||
|
if (title != null) {
|
||||||
|
return Stack(
|
||||||
|
clipBehavior: .none,
|
||||||
|
children: [
|
||||||
|
child,
|
||||||
|
Positioned(
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
child: _headerWrapper(_headerTitle(title)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return child;
|
||||||
}
|
}
|
||||||
final controller = headerControllerBuilder();
|
final controller = headerControllerBuilder();
|
||||||
final memCacheWidth = width.cacheSize(context);
|
final memCacheWidth = width.cacheSize(context);
|
||||||
@@ -597,6 +612,7 @@ class UserInfoCard extends StatelessWidget {
|
|||||||
onPageChanged: controller.jumpToPage,
|
onPageChanged: controller.jumpToPage,
|
||||||
),
|
),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
clipBehavior: .none,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: .infinity,
|
width: .infinity,
|
||||||
@@ -628,33 +644,13 @@ class UserInfoCard extends StatelessWidget {
|
|||||||
Positioned(
|
Positioned(
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 3.5,
|
bottom: 3.5,
|
||||||
child: IgnorePointer(
|
child: _headerWrapper(
|
||||||
child: ConstrainedBox(
|
HeaderTitle(
|
||||||
constraints: const BoxConstraints(maxWidth: 125),
|
|
||||||
child: DecoratedBox(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: .centerLeft,
|
|
||||||
end: .centerRight,
|
|
||||||
colors: [
|
|
||||||
Colors.transparent,
|
|
||||||
Colors.black12,
|
|
||||||
Colors.black38,
|
|
||||||
Colors.black45,
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const .only(left: 15, right: 5, bottom: 2),
|
|
||||||
child: HeaderTitle(
|
|
||||||
images: imgUrls,
|
images: imgUrls,
|
||||||
pageController: controller,
|
pageController: controller,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
@@ -1042,6 +1038,11 @@ class _HeaderTitleState extends State<HeaderTitle> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final title = widget.images[_index].title;
|
final title = widget.images[_index].title;
|
||||||
if (title == null) return const SizedBox.shrink();
|
if (title == null) return const SizedBox.shrink();
|
||||||
|
return _headerTitle(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _headerTitle(TopTitle title) {
|
||||||
try {
|
try {
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: .end,
|
crossAxisAlignment: .end,
|
||||||
@@ -1073,5 +1074,30 @@ class _HeaderTitleState extends State<HeaderTitle> {
|
|||||||
}
|
}
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _headerWrapper(Widget child) {
|
||||||
|
return IgnorePointer(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 125),
|
||||||
|
child: DecoratedBox(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: .centerLeft,
|
||||||
|
end: .centerRight,
|
||||||
|
colors: [
|
||||||
|
Colors.transparent,
|
||||||
|
Colors.black12,
|
||||||
|
Colors.black38,
|
||||||
|
Colors.black45,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const .only(left: 15, right: 5, bottom: 2),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user