mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: member prInfo
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -535,70 +535,67 @@ class UserInfoCard extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
..._buildLeft(context),
|
..._buildLeft(context),
|
||||||
if (card.prInfo?.content?.isNotEmpty == true)
|
if (card.prInfo?.content?.isNotEmpty == true) buildPrInfo,
|
||||||
Builder(builder: (context) {
|
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
|
||||||
final textColor = isDark
|
|
||||||
? Color(int.parse(
|
|
||||||
'FF${card.prInfo?.textColorNight?.substring(1)}',
|
|
||||||
radix: 16))
|
|
||||||
: Color(int.parse('FF${card.prInfo?.textColor?.substring(1)}',
|
|
||||||
radix: 16));
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
if (card.prInfo?.url?.isNotEmpty == true) {
|
|
||||||
Utils.handleWebview(card.prInfo!.url!);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
margin: const EdgeInsets.only(top: 8),
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
|
||||||
color: isDark
|
|
||||||
? Color(int.parse(
|
|
||||||
'FF${card.prInfo?.bgColorNight?.substring(1)}',
|
|
||||||
radix: 16))
|
|
||||||
: Color(int.parse(
|
|
||||||
'FF${card.prInfo?.bgColor?.substring(1)}',
|
|
||||||
radix: 16)),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
if (isDark &&
|
|
||||||
card.prInfo?.iconNight?.isNotEmpty == true) ...[
|
|
||||||
CachedNetworkImage(
|
|
||||||
imageUrl: card.prInfo!.iconNight!,
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
|
||||||
] else if (card.prInfo?.icon?.isNotEmpty == true) ...[
|
|
||||||
CachedNetworkImage(
|
|
||||||
imageUrl: card.prInfo!.icon!,
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 16),
|
|
||||||
],
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
card.prInfo!.content!,
|
|
||||||
style: TextStyle(fontSize: 13, color: textColor),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (card.prInfo?.url?.isNotEmpty == true) ...[
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Icon(
|
|
||||||
Icons.keyboard_arrow_right,
|
|
||||||
color: textColor,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Widget get buildPrInfo => Builder(builder: (context) {
|
||||||
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
final textColor = isDark
|
||||||
|
? Color(int.parse('FF${card.prInfo?.textColorNight?.substring(1)}',
|
||||||
|
radix: 16))
|
||||||
|
: Color(int.parse('FF${card.prInfo?.textColor?.substring(1)}',
|
||||||
|
radix: 16));
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (card.prInfo?.url?.isNotEmpty == true) {
|
||||||
|
Utils.handleWebview(card.prInfo!.url!);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.only(top: 8),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
|
color: isDark
|
||||||
|
? Color(int.parse(
|
||||||
|
'FF${card.prInfo?.bgColorNight?.substring(1)}',
|
||||||
|
radix: 16))
|
||||||
|
: Color(int.parse('FF${card.prInfo?.bgColor?.substring(1)}',
|
||||||
|
radix: 16)),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
if (isDark && card.prInfo?.iconNight?.isNotEmpty == true) ...[
|
||||||
|
CachedNetworkImage(
|
||||||
|
imageUrl: card.prInfo!.iconNight!,
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
] else if (card.prInfo?.icon?.isNotEmpty == true) ...[
|
||||||
|
CachedNetworkImage(
|
||||||
|
imageUrl: card.prInfo!.icon!,
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
],
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
card.prInfo!.content!,
|
||||||
|
style: TextStyle(fontSize: 13, color: textColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (card.prInfo?.url?.isNotEmpty == true) ...[
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
Icon(
|
||||||
|
Icons.keyboard_arrow_right,
|
||||||
|
color: textColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
_buildLiveBadge(context) => GestureDetector(
|
_buildLiveBadge(context) => GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed('/liveRoom?roomid=${live['roomid']}');
|
Get.toNamed('/liveRoom?roomid=${live['roomid']}');
|
||||||
@@ -638,61 +635,68 @@ class UserInfoCard extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_buildHeader(context),
|
_buildHeader(context),
|
||||||
Row(
|
SafeArea(
|
||||||
children: [
|
top: false,
|
||||||
SizedBox(width: MediaQuery.paddingOf(context).left),
|
bottom: false,
|
||||||
const SizedBox(width: 20),
|
child: Row(
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
const SizedBox(width: 20),
|
||||||
child: Stack(
|
Padding(
|
||||||
clipBehavior: Clip.none,
|
padding: EdgeInsets.only(
|
||||||
children: [
|
top: 10,
|
||||||
_buildAvatar(context),
|
bottom: card.prInfo?.content?.isNotEmpty == true ? 0 : 10,
|
||||||
if (ModuleAuthorModel.showDynDecorate &&
|
),
|
||||||
card.pendant?.image?.isNotEmpty == true)
|
child: Stack(
|
||||||
Positioned(
|
clipBehavior: Clip.none,
|
||||||
top: -27.5,
|
children: [
|
||||||
left: -27.5,
|
_buildAvatar(context),
|
||||||
child: IgnorePointer(
|
if (ModuleAuthorModel.showDynDecorate &&
|
||||||
child: CachedNetworkImage(
|
card.pendant?.image?.isNotEmpty == true)
|
||||||
width: 140,
|
Positioned(
|
||||||
height: 140,
|
top: -27.5,
|
||||||
imageUrl: card.pendant!.image!,
|
left: -27.5,
|
||||||
|
child: IgnorePointer(
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
width: 140,
|
||||||
|
height: 140,
|
||||||
|
imageUrl: card.pendant!.image!,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
if (card.officialVerify?.icon?.isNotEmpty == true ||
|
||||||
if (card.officialVerify?.icon?.isNotEmpty == true ||
|
(card.vip?.vipStatus ?? -1) > 0)
|
||||||
(card.vip?.vipStatus ?? -1) > 0)
|
Positioned(
|
||||||
Positioned(
|
right: 0,
|
||||||
right: 0,
|
bottom: 0,
|
||||||
bottom: 0,
|
child: _buildBadge(context),
|
||||||
child: _buildBadge(context),
|
),
|
||||||
),
|
if (live is Map &&
|
||||||
if (live is Map && ((live['liveStatus'] as int?) ?? 0) == 1)
|
((live['liveStatus'] as int?) ?? 0) == 1)
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
bottom: -5,
|
bottom: -5,
|
||||||
right: 0,
|
right: 0,
|
||||||
child: _buildLiveBadge(context),
|
child: _buildLiveBadge(context),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
Expanded(
|
child: Column(
|
||||||
child: Column(
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisSize: MainAxisSize.min,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
const SizedBox(height: 10),
|
||||||
const SizedBox(height: 10),
|
..._buildLeft(context),
|
||||||
..._buildLeft(context),
|
const SizedBox(height: 5),
|
||||||
const SizedBox(height: 5),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(child: _buildRight(context)),
|
||||||
Expanded(child: _buildRight(context)),
|
],
|
||||||
SizedBox(width: MediaQuery.paddingOf(context).right),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
if (card.prInfo?.content?.isNotEmpty == true) buildPrInfo,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user