feat(divination): 为解卦结果的断卦要点添加复制按钮
This commit is contained in:
@@ -547,6 +547,7 @@ class _FocusPointsCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final languageCode = Localizations.localeOf(context).languageCode;
|
||||
final title = languageCode == 'en' ? 'Focus Points' : '断卦要点';
|
||||
if (points.isEmpty) {
|
||||
@@ -563,6 +564,8 @@ class _FocusPointsCard extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(AppSpacing.lg),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
@@ -571,6 +574,25 @@ class _FocusPointsCard extends StatelessWidget {
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
final content = points
|
||||
.asMap()
|
||||
.entries
|
||||
.map((e) => '${e.key + 1}. ${e.value}')
|
||||
.join('\n');
|
||||
Clipboard.setData(ClipboardData(text: content));
|
||||
Toast.show(
|
||||
context,
|
||||
l10n.toastContentCopiedWithTitle(title),
|
||||
type: ToastType.success,
|
||||
);
|
||||
},
|
||||
child: Text(l10n.resultCopy),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: AppSpacing.sm),
|
||||
...List<Widget>.generate(points.length, (index) {
|
||||
return Padding(
|
||||
|
||||
Reference in New Issue
Block a user