From 3f8e010257a1423bc43a51b398889c73ebd9ae1b Mon Sep 17 00:00:00 2001 From: Npepperlinux Date: Fri, 18 Oct 2024 14:26:09 +0900 Subject: [PATCH] =?UTF-8?q?(Linux)=20"=E3=83=8E=E3=83=BC=E3=83=88=E3=81=AE?= =?UTF-8?q?=E5=85=B1=E6=9C=89"=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../note_modal_sheet/note_modal_sheet.dart | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/lib/view/note_modal_sheet/note_modal_sheet.dart b/lib/view/note_modal_sheet/note_modal_sheet.dart index 09bdffa5f..5e0ecd46b 100644 --- a/lib/view/note_modal_sheet/note_modal_sheet.dart +++ b/lib/view/note_modal_sheet/note_modal_sheet.dart @@ -3,6 +3,7 @@ import "dart:io"; import "dart:ui"; import "package:auto_route/auto_route.dart"; +import "package:flutter/foundation.dart"; import "package:flutter/material.dart"; import "package:flutter/rendering.dart"; import "package:flutter/services.dart"; @@ -366,26 +367,29 @@ class NoteModalSheet extends ConsumerWidget implements AutoRouteWrapper { .read(misskeyNoteNotifierProvider.notifier) .openNoteInOtherAccount(targetNote), ), - ListTile( - leading: const Icon(Icons.share), - title: Text(S.of(context).shareNotes), - onTap: () { - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - Future(() async { - if (!context.mounted) return; - final box = context.findRenderObject() as RenderBox?; - if (box == null) return; - final boundary = noteBoundaryKey.currentContext! - .findRenderObject()! as RenderRepaintBoundary; - await ref.read(targetNoteNotifierProvider.notifier).copyAsImage( - box, - boundary, - View.of(context).devicePixelRatio, - ); + if (defaultTargetPlatform != TargetPlatform.linux) + ListTile( + leading: const Icon(Icons.share), + title: Text(S.of(context).shareNotes), + onTap: () { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + Future(() async { + if (!context.mounted) return; + final box = context.findRenderObject() as RenderBox?; + if (box == null) return; + final boundary = noteBoundaryKey.currentContext! + .findRenderObject()! as RenderRepaintBoundary; + await ref + .read(targetNoteNotifierProvider.notifier) + .copyAsImage( + box, + boundary, + View.of(context).devicePixelRatio, + ); + }); }); - }); - }, - ), + }, + ), if (accountContext.isSame) switch (noteStatus) { null => const SizedBox.shrink(),