Easy way to copy sticker pack

This commit is contained in:
LittleSheep 2025-05-11 22:28:12 +08:00
parent 863eca364f
commit e61497dc70
2 changed files with 16 additions and 1 deletions

View File

@ -178,5 +178,6 @@
"pickFile": "Pick a file",
"uploading": "Uploading",
"uploadingProgress": "Uploading {} of {}",
"uploadAll": "Upload All"
"uploadAll": "Upload All",
"stickerCopyPlaceholder": "Copy Placeholder"
}

View File

@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import 'package:dio/dio.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:gap/gap.dart';
@ -157,6 +158,19 @@ class StickerPackDetailScreen extends HookConsumerWidget {
menuProvider: (_) {
return Menu(
children: [
MenuAction(
title: 'stickerCopyPlaceholder'.tr(),
image: MenuImage.icon(Symbols.copy_all),
callback: () {
Clipboard.setData(
ClipboardData(
text:
':${pack.prefix}${sticker.slug}:',
),
);
},
),
MenuSeparator(),
MenuAction(
title: 'edit'.tr(),
image: MenuImage.icon(Symbols.edit),