Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux]ノートの共有をLinuxのみ削除する #482

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading