Skip to content

Commit

Permalink
(Linux) "ノートの共有"を削除
Browse files Browse the repository at this point in the history
  • Loading branch information
Npepperlinux committed Dec 20, 2024
1 parent b01c83c commit 3f8e010
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions lib/view/note_modal_sheet/note_modal_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 3f8e010

Please sign in to comment.