mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 00:56:31 +08:00
opt pgc review score
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -42,6 +42,12 @@ class _PgcReviewPostPanelState
|
|||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _onScore(double dx) {
|
||||||
|
int index = (dx / 50).toInt().clamp(0, 4);
|
||||||
|
_enablePost.value = true;
|
||||||
|
_score.value = index + 1;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget buildPage(ThemeData theme) {
|
Widget buildPage(ThemeData theme) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
@@ -76,34 +82,35 @@ class _PgcReviewPostPanelState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Center(
|
||||||
padding: const EdgeInsets.only(top: 20, bottom: 10),
|
child: Padding(
|
||||||
child: Row(
|
padding: const EdgeInsets.only(top: 20, bottom: 10),
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: GestureDetector(
|
||||||
children: List.generate(
|
behavior: HitTestBehavior.opaque,
|
||||||
5,
|
onHorizontalDragUpdate: (details) =>
|
||||||
(index) {
|
_onScore(details.localPosition.dx),
|
||||||
return Obx(
|
onTapDown: (details) => _onScore(details.localPosition.dx),
|
||||||
() => GestureDetector(
|
child: Row(
|
||||||
onTap: () {
|
mainAxisSize: MainAxisSize.min,
|
||||||
_enablePost.value = true;
|
children: List.generate(
|
||||||
_score.value = index + 1;
|
5,
|
||||||
},
|
(index) {
|
||||||
behavior: HitTestBehavior.opaque,
|
return Obx(
|
||||||
child: index <= _score.value - 1
|
() => index <= _score.value - 1
|
||||||
? const Icon(
|
? const Icon(
|
||||||
CustomIcon.star_favorite_solid,
|
CustomIcon.star_favorite_solid,
|
||||||
size: 50,
|
size: 50,
|
||||||
color: Color(0xFFFFAD35),
|
color: Color(0xFFFFAD35),
|
||||||
)
|
)
|
||||||
: const Icon(
|
: const Icon(
|
||||||
CustomIcon.star_favorite_line,
|
CustomIcon.star_favorite_line,
|
||||||
size: 50,
|
size: 50,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
},
|
||||||
},
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ class SpaceSettingController
|
|||||||
if (data != null) {
|
if (data != null) {
|
||||||
var res = await UserHttp.spaceSettingMod(
|
var res = await UserHttp.spaceSettingMod(
|
||||||
{
|
{
|
||||||
for (var e in data.list1) ...{e.key: e.value},
|
for (var e in data.list1) e.key: e.value,
|
||||||
for (var e in data.list2) ...{e.key: e.value},
|
for (var e in data.list2) e.key: e.value,
|
||||||
for (var e in data.list3) ...{e.key: e.value},
|
for (var e in data.list3) e.key: e.value,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (!res['status']) {
|
if (!res['status']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user