buildPasteButton method

Widget buildPasteButton(
  1. {required BuildContext context,
  2. required WidgetRef ref,
  3. required AppModel appModel}
)

Menu bar action.

Implementation

Widget buildPasteButton(
    {required BuildContext context,
    required WidgetRef ref,
    required AppModel appModel}) {
  return FloatingSearchBarAction(
    child: JidoujishoIconButton(
      size: Theme.of(context).textTheme.titleLarge?.fontSize,
      tooltip: t.paste,
      icon: Icons.note_alt_outlined,
      onTap: () async {
        ClipboardData? data = await Clipboard.getData('text/plain');
        ref.watch(clipboardProvider.notifier).state = data?.text ?? '';
      },
    ),
  );
}