feat: space opus

Closes #833

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-08 22:39:29 +08:00
parent bcd0d63db7
commit 2d75d89825
28 changed files with 1107 additions and 511 deletions

View File

@@ -90,124 +90,122 @@ class _EditProfilePageState extends State<EditProfilePage> {
return switch (loadingState) {
Loading() => loadingWidget,
Success() => SingleChildScrollView(
child: Column(
children: [
_item(
theme: theme,
title: '头像',
widget: Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: ClipOval(
child: CachedNetworkImage(
imageUrl:
Utils.thumbnailImgUrl(loadingState.response['face']),
),
Success() => ListView(
children: [
_item(
theme: theme,
title: '头像',
widget: Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: ClipOval(
child: CachedNetworkImage(
imageUrl:
Utils.thumbnailImgUrl(loadingState.response['face']),
),
),
onTap: () {
EasyThrottle.throttle(
'imagePicker', const Duration(milliseconds: 500), () {
_pickImg(theme);
});
},
),
divider,
_item(
theme: theme,
title: '昵称',
text: loadingState.response['name'],
onTap: () {
if (loadingState.response['coins'] < 6) {
SmartDialog.showToast('硬币不足');
} else {
_editDialog(
type: ProfileType.uname,
title: '昵称',
text: loadingState.response['name'],
onTap: () {
EasyThrottle.throttle(
'imagePicker', const Duration(milliseconds: 500), () {
_pickImg(theme);
});
},
),
divider,
_item(
theme: theme,
title: '昵称',
text: loadingState.response['name'],
onTap: () {
if (loadingState.response['coins'] < 6) {
SmartDialog.showToast('硬币不足');
} else {
_editDialog(
type: ProfileType.uname,
title: '昵称',
text: loadingState.response['name'],
);
}
},
),
divider,
_item(
theme: theme,
title: '性别',
text: _sex(loadingState.response['sex']),
onTap: () {
showDialog(
context: context,
builder: (context_) =>
_sexDialog(loadingState.response['sex']),
);
},
),
divider,
_item(
theme: theme,
title: '出生年月',
text: loadingState.response['birthday'],
onTap: () {
showDatePicker(
context: context,
initialDate:
DateTime.parse(loadingState.response['birthday']),
firstDate: DateTime(1900, 1, 1),
lastDate: DateTime.now(),
).then((date) {
if (date != null) {
_update(
type: ProfileType.birthday,
datum: DateFormat('yyyy-MM-dd').format(date),
);
}
},
),
divider,
_item(
theme: theme,
title: '性别',
text: _sex(loadingState.response['sex']),
onTap: () {
showDialog(
context: context,
builder: (context_) =>
_sexDialog(loadingState.response['sex']),
);
},
),
divider,
_item(
theme: theme,
title: '出生年月',
text: loadingState.response['birthday'],
onTap: () {
showDatePicker(
context: context,
initialDate:
DateTime.parse(loadingState.response['birthday']),
firstDate: DateTime(1900, 1, 1),
lastDate: DateTime.now(),
).then((date) {
if (date != null) {
_update(
type: ProfileType.birthday,
datum: DateFormat('yyyy-MM-dd').format(date),
);
}
});
},
),
divider,
_item(
theme: theme,
title: '个性签名',
text: loadingState.response['sign'].isEmpty
? ''
: loadingState.response['sign'],
onTap: () {
_editDialog(
type: ProfileType.sign,
title: '个性签名',
text: loadingState.response['sign'],
);
},
),
divider1,
_item(
theme: theme,
title: '头像挂件',
onTap: () => PageUtils.launchURL(
'https://www.bilibili.com/h5/mall/pendant/home'),
),
divider1,
_item(
theme: theme,
title: 'UID',
needIcon: false,
text: loadingState.response['mid'].toString(),
onTap: () =>
Utils.copyText(loadingState.response['mid'].toString()),
),
divider1,
_item(
theme: theme,
title: '哔哩哔哩认证',
onTap: () => PageUtils.launchURL(
'https://account.bilibili.com/official/mobile/home'),
),
divider,
SizedBox(height: 25 + MediaQuery.paddingOf(context).bottom),
],
),
});
},
),
divider,
_item(
theme: theme,
title: '个性签名',
text: loadingState.response['sign'].isEmpty
? ''
: loadingState.response['sign'],
onTap: () {
_editDialog(
type: ProfileType.sign,
title: '个性签名',
text: loadingState.response['sign'],
);
},
),
divider1,
_item(
theme: theme,
title: '头像挂件',
onTap: () => PageUtils.launchURL(
'https://www.bilibili.com/h5/mall/pendant/home'),
),
divider1,
_item(
theme: theme,
title: 'UID',
needIcon: false,
text: loadingState.response['mid'].toString(),
onTap: () =>
Utils.copyText(loadingState.response['mid'].toString()),
),
divider1,
_item(
theme: theme,
title: '哔哩哔哩认证',
onTap: () => PageUtils.launchURL(
'https://account.bilibili.com/official/mobile/home'),
),
divider,
SizedBox(height: 25 + MediaQuery.paddingOf(context).bottom),
],
),
Error() => errorWidget(
Error() => scrollErrorWidget(
errMsg: loadingState.errMsg,
onReload: _getInfo,
),