Sticker pack set icon

This commit is contained in:
2025-12-05 01:25:38 +08:00
parent 562bdf62e9
commit 5b3c138ebe
5 changed files with 102 additions and 27 deletions

View File

@@ -320,7 +320,6 @@ class StickerForm extends HookConsumerWidget {
final formKey = useMemoized(() => GlobalKey<FormState>(), []);
final image = useState<String?>(id == null ? '' : sticker.value?.image.id);
final imageController = useTextEditingController(text: image.value);
final slugController = useTextEditingController(
text: id == null ? '' : sticker.value?.slug,
);
@@ -328,7 +327,6 @@ class StickerForm extends HookConsumerWidget {
useEffect(() {
if (sticker.value != null) {
image.value = sticker.value!.image.id;
imageController.text = sticker.value!.image.id;
slugController.text = sticker.value!.slug;
}
return null;
@@ -344,7 +342,7 @@ class StickerForm extends HookConsumerWidget {
id == null
? '/sphere/stickers/$packId/content'
: '/sphere/stickers/$packId/content/$id',
data: {'slug': slugController.text, 'image_id': imageController.text},
data: {'slug': slugController.text, 'image_id': image.value},
options: Options(method: id == null ? 'POST' : 'PATCH'),
);
if (context.mounted) {
@@ -392,7 +390,6 @@ class StickerForm extends HookConsumerWidget {
).then((value) {
if (value == null) return;
image.value = value[0].id;
imageController.text = image.value!;
});
},
icon: const Icon(Symbols.cloud_upload),