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,24 +133,26 @@ class _MinePageState extends State<MinePage> {
GestureDetector( GestureDetector(
onTap: _mineController.onLogin, onTap: _mineController.onLogin,
child: ClipOval( child: ClipOval(
child: Container( child: _mineController.userInfo.value.face != null
width: 70, ? NetworkImgLayer(
height: 70, src: _mineController.userInfo.value.face,
color: Theme.of(context).colorScheme.onInverseSurface, semanticsLabel: '头像',
child: Center( width: 50,
child: _mineController.userInfo.value.face != null height: 50,
? NetworkImgLayer( )
src: _mineController.userInfo.value.face, : Container(
semanticsLabel: '头像', width: 50,
width: 70, height: 50,
height: 70, alignment: Alignment.center,
) decoration: BoxDecoration(
: Image.asset( shape: BoxShape.circle,
'assets/images/noface.jpeg', color: Theme.of(context).colorScheme.onInverseSurface,
semanticLabel: "默认头像", ),
), child: Image.asset(
), 'assets/images/noface.jpeg',
), semanticLabel: "默认头像",
),
),
), ),
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
@@ -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,15 +248,18 @@ class _MinePageState extends State<MinePage> {
), ),
), ),
const SizedBox(height: 4), const SizedBox(height: 4),
LinearProgressIndicator( SizedBox(
minHeight: 2, height: 2,
value: levelInfo != null child: LinearProgressIndicator(
? (levelInfo.currentExp! / levelInfo.nextExp!) minHeight: 2,
: 0, value: levelInfo != null
backgroundColor: ? (levelInfo.currentExp! / levelInfo.nextExp!)
Theme.of(context).colorScheme.inversePrimary, : 0,
valueColor: AlwaysStoppedAnimation<Color>( backgroundColor:
Theme.of(context).colorScheme.primary), Theme.of(context).colorScheme.inversePrimary,
valueColor: AlwaysStoppedAnimation<Color>(
Theme.of(context).colorScheme.primary),
),
), ),
], ],
), ),
@@ -303,20 +311,12 @@ class _MinePageState extends State<MinePage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
AnimatedSwitcher( Text(
duration: const Duration(milliseconds: 400), (_mineController.userStat.value.following ?? '-')
transitionBuilder: .toString(),
(Widget child, Animation<double> animation) { key: ValueKey<String>(
return ScaleTransition(scale: animation, child: child); _mineController.userStat.value.following.toString()),
}, style: style,
child: Text(
(_mineController.userStat.value.following ?? '-')
.toString(),
key: ValueKey<String>(_mineController
.userStat.value.following
.toString()),
style: style,
),
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
Text( Text(