Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-19 13:43:36 +08:00
parent 6f48a97b4b
commit 9b8d4a62fa
3 changed files with 103 additions and 89 deletions

View File

@@ -155,12 +155,14 @@ class _CreateFavPageState extends State<CreateFavPage> {
bucket: 'medialist', bucket: 'medialist',
dir: 'cover', dir: 'cover',
).then((res) { ).then((res) {
if (context.mounted) {
if (res['status']) { if (res['status']) {
_cover = res['data']['location']; _cover = res['data']['location'];
(context as Element).markNeedsBuild(); (context as Element).markNeedsBuild();
} else { } else {
SmartDialog.showToast(res['msg']); SmartDialog.showToast(res['msg']);
} }
}
}); });
} }
} }

View File

@@ -188,9 +188,7 @@ class _PayCoinsPageState extends State<PayCoinsPage>
} }
void _scale() { void _scale() {
_scale22Controller.forward().whenComplete(() { _scale22Controller.forward().whenComplete(_scale22Controller.reverse);
_scale22Controller.reverse();
});
} }
void _onScroll(int index) { void _onScroll(int index) {
@@ -478,9 +476,7 @@ class _PayCoinsPageState extends State<PayCoinsPage>
} }
}); });
} }
_boxAnimController.forward().whenComplete(() { _boxAnimController.forward().whenComplete(_boxAnimController.reverse);
_boxAnimController.reverse();
});
_coinSlideController.forward().whenComplete(() { _coinSlideController.forward().whenComplete(() {
_coinFadeController.forward().whenComplete(() { _coinFadeController.forward().whenComplete(() {
Get.back(); Get.back();

View File

@@ -163,7 +163,9 @@ class _PostPanelState extends CommonCollapseSlidePageState<PostPanel> {
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
], ],
Wrap( Builder(
builder: (context) {
return Wrap(
runSpacing: 8, runSpacing: 8,
spacing: 16, spacing: 16,
children: [ children: [
@@ -171,9 +173,7 @@ class _PostPanelState extends CommonCollapseSlidePageState<PostPanel> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text('分类: '), const Text('分类: '),
Builder( PopupMenuButton<SegmentType>(
builder: (context) {
return PopupMenuButton<SegmentType>(
initialValue: initialValue:
list![index].category, list![index].category,
onSelected: (item) { onSelected: (item) {
@@ -249,8 +249,6 @@ class _PostPanelState extends CommonCollapseSlidePageState<PostPanel> {
), ),
], ],
), ),
);
},
), ),
], ],
), ),
@@ -258,13 +256,17 @@ class _PostPanelState extends CommonCollapseSlidePageState<PostPanel> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const Text('行为类别: '), const Text('行为类别: '),
Builder(builder: (context) { Builder(
return PopupMenuButton<ActionType>( builder: (context) {
return PopupMenuButton<
ActionType>(
initialValue: initialValue:
list![index].actionType, list![index].actionType,
onSelected: (item) { onSelected: (item) {
list![index].actionType = item; list![index].actionType =
if (item == ActionType.full) { item;
if (item ==
ActionType.full) {
updateSegment( updateSegment(
isFirst: true, isFirst: true,
index: index, index: index,
@@ -274,51 +276,65 @@ class _PostPanelState extends CommonCollapseSlidePageState<PostPanel> {
(context as Element) (context as Element)
.markNeedsBuild(); .markNeedsBuild();
}, },
itemBuilder: (context) => ActionType itemBuilder: (context) =>
.values ActionType.values
.map( .map(
(item) => (item) =>
PopupMenuItem<ActionType>( PopupMenuItem<
enabled: list![index] ActionType>(
enabled: list![
index]
.category .category
.toActionType .toActionType
.contains(item), .contains(
item),
value: item, value: item,
child: Text(item.title), child: Text(
item.title),
), ),
) )
.toList(), .toList(),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize:
MainAxisSize.min,
children: [ children: [
Text( Text(
list![index].actionType.title, list![index]
.actionType
.title,
style: TextStyle( style: TextStyle(
height: 1, height: 1,
fontSize: 14, fontSize: 14,
color: theme color: theme
.colorScheme.secondary, .colorScheme
.secondary,
), ),
strutStyle: const StrutStyle( strutStyle:
const StrutStyle(
height: 1, height: 1,
leading: 0, leading: 0,
), ),
), ),
Icon( Icon(
MdiIcons.unfoldMoreHorizontal, MdiIcons
size: MediaQuery.textScalerOf( .unfoldMoreHorizontal,
size: MediaQuery
.textScalerOf(
context) context)
.scale(14), .scale(14),
color: theme color: theme.colorScheme
.colorScheme.secondary, .secondary,
), ),
], ],
), ),
); );
}), },
),
], ],
), ),
], ],
);
},
), ),
], ],
), ),