mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
@@ -78,6 +78,8 @@ Widget content(
|
|||||||
style: isSave
|
style: isSave
|
||||||
? const TextStyle(fontSize: 15)
|
? const TextStyle(fontSize: 15)
|
||||||
: const TextStyle(fontSize: 16),
|
: const TextStyle(fontSize: 16),
|
||||||
|
contextMenuBuilder: (_, state) =>
|
||||||
|
_contextMenuBuilder(state, moduleDynamic),
|
||||||
)
|
)
|
||||||
: custom_text.Text.rich(
|
: custom_text.Text.rich(
|
||||||
style: floor == 1
|
style: floor == 1
|
||||||
@@ -107,3 +109,37 @@ Widget content(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _contextMenuBuilder(
|
||||||
|
EditableTextState state,
|
||||||
|
ModuleDynamicModel? moduleDynamic,
|
||||||
|
) {
|
||||||
|
return AdaptiveTextSelectionToolbar.buttonItems(
|
||||||
|
buttonItems: state.contextMenuButtonItems
|
||||||
|
..add(
|
||||||
|
ContextMenuButtonItem(
|
||||||
|
label: '文本',
|
||||||
|
onPressed: () => _onCopyText(moduleDynamic),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
anchors: state.contextMenuAnchors,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onCopyText(ModuleDynamicModel? moduleDynamic) {
|
||||||
|
final text =
|
||||||
|
moduleDynamic?.desc?.text ?? moduleDynamic?.major?.opus?.summary?.text;
|
||||||
|
if (text == null || text.isEmpty) return;
|
||||||
|
showDialog(
|
||||||
|
context: Get.context!,
|
||||||
|
builder: (context) => Dialog(
|
||||||
|
child: Padding(
|
||||||
|
padding: const .symmetric(horizontal: 20, vertical: 16),
|
||||||
|
child: SelectableText(
|
||||||
|
text,
|
||||||
|
style: const TextStyle(fontSize: 15, height: 1.7),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user