Skip to content

Commit 2a16bec

Browse files
committed
chore: Trimming paste image. #1
1 parent 5bf27ce commit 2a16bec

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

lib/home_page.dart

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class _HomePageState extends State<HomePage> {
142142
enableSelectionToolbar: isMobile(),
143143
expands: false,
144144
padding: EdgeInsets.zero,
145-
onImagePaste: _onImagePaste,
146145
onTapUp: (details, p1) {
147146
return _onTripleClickSelection();
148147
},
@@ -320,34 +319,4 @@ class _HomePageState extends State<HomePage> {
320319

321320
return onImagePickCallback(file);
322321
}
323-
324-
// ignore: unused_element
325-
Future<MediaPickSetting?> _selectMediaPickSetting(BuildContext context) => showDialog<MediaPickSetting>(
326-
context: context,
327-
builder: (ctx) => AlertDialog(
328-
contentPadding: EdgeInsets.zero,
329-
content: Column(
330-
mainAxisSize: MainAxisSize.min,
331-
children: [
332-
TextButton.icon(
333-
icon: const Icon(Icons.collections),
334-
label: const Text('Gallery'),
335-
onPressed: () => Navigator.pop(ctx, MediaPickSetting.Gallery),
336-
),
337-
TextButton.icon(
338-
icon: const Icon(Icons.link),
339-
label: const Text('Link'),
340-
onPressed: () => Navigator.pop(ctx, MediaPickSetting.Link),
341-
)
342-
],
343-
),
344-
),
345-
);
346-
347-
Future<String> _onImagePaste(Uint8List imageBytes) async {
348-
// Saves the image to applications directory
349-
final appDocDir = await getApplicationDocumentsDirectory();
350-
final file = await File('${appDocDir.path}/${basename('${DateTime.now().millisecondsSinceEpoch}.png')}').writeAsBytes(imageBytes, flush: true);
351-
return file.path.toString();
352-
}
353322
}

0 commit comments

Comments
 (0)