🐛 Bug fixes

This commit is contained in:
2025-07-31 16:48:50 +08:00
parent ba709012d7
commit 715f95ca22
8 changed files with 80 additions and 50 deletions

View File

@@ -26,7 +26,7 @@ part 'pack_detail.freezed.dart';
@riverpod
Future<List<SnSticker>> stickerPackContent(Ref ref, String packId) async {
final apiClient = ref.watch(apiClientProvider);
final resp = await apiClient.get('/stickers/$packId/content');
final resp = await apiClient.get('/sphere/stickers/$packId/content');
return resp.data
.map<SnSticker>((e) => SnSticker.fromJson(e))
.cast<SnSticker>()
@@ -74,13 +74,16 @@ class StickerPackDetailScreen extends HookConsumerWidget {
IconButton(
icon: const Icon(Symbols.add_circle),
onPressed: () {
context.pushNamed('creatorStickerNew', pathParameters: {'packId': id}).then((
value,
) {
if (value != null) {
ref.invalidate(stickerPackContentProvider(id));
}
});
context
.pushNamed(
'creatorStickerNew',
pathParameters: {'name': pubName, 'packId': id},
)
.then((value) {
if (value != null) {
ref.invalidate(stickerPackContentProvider(id));
}
});
},
),
_StickerPackActionMenu(
@@ -173,9 +176,13 @@ class StickerPackDetailScreen extends HookConsumerWidget {
title: 'edit'.tr(),
image: MenuImage.icon(Symbols.edit),
callback: () {
context.pushNamed(
context
.pushNamed(
'creatorStickerEdit',
pathParameters: {'packId': id, 'id': sticker.id},
pathParameters: {
'packId': id,
'id': sticker.id,
},
)
.then((value) {
if (value != null) {
@@ -259,9 +266,7 @@ class _StickerPackActionMenu extends HookConsumerWidget {
(context) => [
PopupMenuItem(
onTap: () {
context.push(
'/creators/$pubName/stickers/$packId/edit',
);
context.push('/creators/$pubName/stickers/$packId/edit');
},
child: Row(
children: [

View File

@@ -31,7 +31,7 @@ class StickersScreen extends HookConsumerWidget {
context
.pushNamed(
'creatorStickerPackNew',
queryParameters: {'pubName': pubName},
queryParameters: {'name': pubName},
)
.then((value) {
if (value != null) {
@@ -76,7 +76,7 @@ class SliverStickerPacksList extends HookConsumerWidget {
onTap: () {
context.pushNamed(
'creatorStickerPackDetail',
pathParameters: {'pubName': pubName, 'packId': sticker.id},
pathParameters: {'name': pubName, 'packId': sticker.id},
);
},
);