opt: mine page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-08 18:45:28 +08:00
parent 71daa6df29
commit 34c024239d

View File

@@ -133,26 +133,28 @@ class _MinePageState extends State<MinePage> {
GestureDetector( GestureDetector(
onTap: _mineController.onLogin, onTap: _mineController.onLogin,
child: ClipOval( child: ClipOval(
child: Container(
width: 70,
height: 70,
color: Theme.of(context).colorScheme.onInverseSurface,
child: Center(
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: 70, width: 50,
height: 70, height: 50,
) )
: Image.asset( : Container(
width: 50,
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).colorScheme.onInverseSurface,
),
child: Image.asset(
'assets/images/noface.jpeg', 'assets/images/noface.jpeg',
semanticLabel: "默认头像", semanticLabel: "默认头像",
), ),
), ),
), ),
), ),
),
const SizedBox(width: 16), const SizedBox(width: 16),
Expanded( Expanded(
child: Column( child: Column(
@@ -166,7 +168,10 @@ class _MinePageState extends State<MinePage> {
children: [ children: [
Text( Text(
_mineController.userInfo.value.uname ?? '点击头像登录', _mineController.userInfo.value.uname ?? '点击头像登录',
style: Theme.of(context).textTheme.titleMedium, style: Theme.of(context)
.textTheme
.titleMedium!
.copyWith(height: 1),
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
Image.asset( Image.asset(
@@ -243,7 +248,9 @@ class _MinePageState extends State<MinePage> {
), ),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
LinearProgressIndicator( SizedBox(
height: 2,
child: LinearProgressIndicator(
minHeight: 2, minHeight: 2,
value: levelInfo != null value: levelInfo != null
? (levelInfo.currentExp! / levelInfo.nextExp!) ? (levelInfo.currentExp! / levelInfo.nextExp!)
@@ -253,6 +260,7 @@ class _MinePageState extends State<MinePage> {
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Theme.of(context).colorScheme.primary), Theme.of(context).colorScheme.primary),
), ),
),
], ],
), ),
), ),
@@ -303,21 +311,13 @@ class _MinePageState extends State<MinePage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AnimatedSwitcher( Text(
duration: const Duration(milliseconds: 400),
transitionBuilder:
(Widget child, Animation<double> animation) {
return ScaleTransition(scale: animation, child: child);
},
child: Text(
(_mineController.userStat.value.following ?? '-') (_mineController.userStat.value.following ?? '-')
.toString(), .toString(),
key: ValueKey<String>(_mineController key: ValueKey<String>(
.userStat.value.following _mineController.userStat.value.following.toString()),
.toString()),
style: style, style: style,
), ),
),
const SizedBox(height: 8), const SizedBox(height: 8),
Text( Text(
'关注', '关注',