mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-18 08:06:21 +08:00
opt: mine page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:PiliPlus/http/loading_state.dart';
|
|||||||
import 'package:PiliPlus/pages/live/controller.dart';
|
import 'package:PiliPlus/pages/live/controller.dart';
|
||||||
import 'package:PiliPlus/pages/live/widgets/live_item.dart';
|
import 'package:PiliPlus/pages/live/widgets/live_item.dart';
|
||||||
import 'package:PiliPlus/pages/live/widgets/live_item_follow.dart';
|
import 'package:PiliPlus/pages/live/widgets/live_item_follow.dart';
|
||||||
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
@@ -230,6 +231,7 @@ class _LivePageState extends State<LivePage>
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
|
feedBack();
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/member?mid=${loadingState.response[index].uid}',
|
'/member?mid=${loadingState.response[index].uid}',
|
||||||
arguments: {
|
arguments: {
|
||||||
|
|||||||
@@ -126,23 +126,24 @@ class _MinePageState extends State<MinePage> {
|
|||||||
return Column(
|
return Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
GestureDetector(
|
||||||
mainAxisSize: MainAxisSize.min,
|
behavior: HitTestBehavior.translucent,
|
||||||
children: [
|
onTap: _mineController.onLogin,
|
||||||
const SizedBox(width: 20),
|
child: Row(
|
||||||
GestureDetector(
|
mainAxisSize: MainAxisSize.min,
|
||||||
onTap: _mineController.onLogin,
|
children: [
|
||||||
child: ClipOval(
|
const SizedBox(width: 20),
|
||||||
|
ClipOval(
|
||||||
child: _mineController.userInfo.value.face != null
|
child: _mineController.userInfo.value.face != null
|
||||||
? NetworkImgLayer(
|
? NetworkImgLayer(
|
||||||
src: _mineController.userInfo.value.face,
|
src: _mineController.userInfo.value.face,
|
||||||
semanticsLabel: '头像',
|
semanticsLabel: '头像',
|
||||||
width: 50,
|
width: 55,
|
||||||
height: 50,
|
height: 55,
|
||||||
)
|
)
|
||||||
: Container(
|
: Container(
|
||||||
width: 50,
|
width: 55,
|
||||||
height: 50,
|
height: 55,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
@@ -154,118 +155,120 @@ class _MinePageState extends State<MinePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 16),
|
||||||
const SizedBox(width: 16),
|
Expanded(
|
||||||
Expanded(
|
child: Column(
|
||||||
child: Column(
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
children: [
|
||||||
children: [
|
FittedBox(
|
||||||
FittedBox(
|
child: Row(
|
||||||
child: Row(
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
_mineController.userInfo.value.uname ?? '点击头像登录',
|
|
||||||
style: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.titleMedium!
|
|
||||||
.copyWith(height: 1),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 4),
|
|
||||||
Image.asset(
|
|
||||||
'assets/images/lv/lv${_mineController.userInfo.value.levelInfo != null ? _mineController.userInfo.value.levelInfo!.currentLevel : '0'}.png',
|
|
||||||
height: 10,
|
|
||||||
semanticLabel:
|
|
||||||
'等级:${_mineController.userInfo.value.levelInfo != null ? _mineController.userInfo.value.levelInfo!.currentLevel : '0'}',
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
FittedBox(
|
|
||||||
child: Text.rich(
|
|
||||||
TextSpan(
|
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
Text(
|
||||||
text: '硬币 ',
|
_mineController.userInfo.value.uname ?? '点击头像登录',
|
||||||
style: TextStyle(
|
style: Theme.of(context)
|
||||||
fontSize: Theme.of(context)
|
.textTheme
|
||||||
.textTheme
|
.titleMedium!
|
||||||
.labelSmall!
|
.copyWith(height: 1),
|
||||||
.fontSize,
|
|
||||||
color: Theme.of(context).colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
TextSpan(
|
const SizedBox(width: 4),
|
||||||
text: (_mineController.userInfo.value.money ?? '-')
|
Image.asset(
|
||||||
.toString(),
|
'assets/images/lv/lv${_mineController.userInfo.value.levelInfo != null ? _mineController.userInfo.value.levelInfo!.currentLevel : '0'}.png',
|
||||||
style: TextStyle(
|
height: 10,
|
||||||
fontSize: Theme.of(context)
|
semanticLabel:
|
||||||
.textTheme
|
'等级:${_mineController.userInfo.value.levelInfo != null ? _mineController.userInfo.value.levelInfo!.currentLevel : '0'}',
|
||||||
.labelSmall!
|
|
||||||
.fontSize,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: " 经验 ",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.labelSmall!
|
|
||||||
.fontSize,
|
|
||||||
color: Theme.of(context).colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: "${levelInfo?.currentExp ?? '-'}",
|
|
||||||
semanticsLabel: "当前${levelInfo?.currentExp ?? '-'}",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.labelSmall!
|
|
||||||
.fontSize,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextSpan(
|
|
||||||
text: "/${levelInfo?.nextExp ?? '-'}",
|
|
||||||
semanticsLabel: "升级需${levelInfo?.nextExp ?? '-'}",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.labelSmall!
|
|
||||||
.fontSize,
|
|
||||||
color: Theme.of(context).colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 8),
|
||||||
const SizedBox(height: 4),
|
FittedBox(
|
||||||
SizedBox(
|
child: Text.rich(
|
||||||
height: 2,
|
TextSpan(
|
||||||
child: LinearProgressIndicator(
|
children: [
|
||||||
minHeight: 2,
|
TextSpan(
|
||||||
value: levelInfo != null
|
text: '硬币 ',
|
||||||
? (levelInfo.currentExp! / levelInfo.nextExp!)
|
style: TextStyle(
|
||||||
: 0,
|
fontSize: Theme.of(context)
|
||||||
backgroundColor:
|
.textTheme
|
||||||
Theme.of(context).colorScheme.inversePrimary,
|
.labelSmall!
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
.fontSize,
|
||||||
Theme.of(context).colorScheme.primary),
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text:
|
||||||
|
(_mineController.userInfo.value.money ?? '-')
|
||||||
|
.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.labelSmall!
|
||||||
|
.fontSize,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: " 经验 ",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.labelSmall!
|
||||||
|
.fontSize,
|
||||||
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: "${levelInfo?.currentExp ?? '-'}",
|
||||||
|
semanticsLabel:
|
||||||
|
"当前${levelInfo?.currentExp ?? '-'}",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.labelSmall!
|
||||||
|
.fontSize,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: "/${levelInfo?.nextExp ?? '-'}",
|
||||||
|
semanticsLabel: "升级需${levelInfo?.nextExp ?? '-'}",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.labelSmall!
|
||||||
|
.fontSize,
|
||||||
|
color: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 4),
|
||||||
],
|
SizedBox(
|
||||||
|
height: 2,
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
minHeight: 2,
|
||||||
|
value: levelInfo != null
|
||||||
|
? (levelInfo.currentExp! / levelInfo.nextExp!)
|
||||||
|
: 0,
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.inversePrimary,
|
||||||
|
valueColor: AlwaysStoppedAnimation<Color>(
|
||||||
|
Theme.of(context).colorScheme.primary),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 20),
|
||||||
const SizedBox(width: 20),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
Reference in New Issue
Block a user