You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -319,60 +317,6 @@ class _FileExplorerCardState extends State<FileExplorerCard> {
319
317
320
318
Stringget _mimeTypeOrEmpty => _file.type ??'';
321
319
322
-
Future<void> _showFileContents() async {
323
-
if (_isDirectory) return;
324
-
325
-
const k10mb =1024*1024*10;
326
-
327
-
if (!_mimeTypeOrEmpty.startsWith(kTextMime) &&
328
-
!_mimeTypeOrEmpty.startsWith(kImageMime)) {
329
-
if (_mimeTypeOrEmpty == kApkMime) {
330
-
returnshowTextToast(
331
-
text:
332
-
'Requesting to install a package (.apk) is not currently supported, to request this feature open an issue at github.com/alexrintt/shared-storage/issues',
333
-
context: context,
334
-
);
335
-
}
336
-
337
-
return_openFileWithExternalApp();
338
-
}
339
-
340
-
// Too long, will take too much time to read
341
-
if (_sizeInBytes > k10mb) {
342
-
returnshowTextToast(
343
-
text:'File too long to open',
344
-
context: context,
345
-
);
346
-
}
347
-
348
-
content =awaitgetDocumentContent(_file.uri);
349
-
350
-
if (content !=null) {
351
-
final isImage = _mimeTypeOrEmpty.startsWith(kImageMime);
352
-
353
-
awaitshowModalBottomSheet(
354
-
context: context,
355
-
builder: (context) {
356
-
if (isImage) {
357
-
returnImage.memory(content!);
358
-
}
359
-
360
-
final contentAsString =String.fromCharCodes(content!);
361
-
362
-
final fileIsEmpty = contentAsString.isEmpty;
363
-
364
-
returnContainer(
365
-
padding: k8dp.all,
366
-
child:Text(
367
-
fileIsEmpty ?'This file is empty': contentAsString,
368
-
style: fileIsEmpty ?disabledTextStyle() :null,
369
-
),
370
-
);
371
-
},
372
-
);
373
-
}
374
-
}
375
-
376
320
Future<void> _deleteDocument() async {
377
321
final deleted =awaitdelete(_currentUri);
378
322
@@ -436,24 +380,6 @@ class _FileExplorerCardState extends State<FileExplorerCard> {
436
380
}
437
381
}
438
382
439
-
Future<void> _openFileWithExternalApp() async {
440
-
final uri = _currentUri;
441
-
442
-
try {
443
-
final launched =awaitopenDocumentFile(uri);
444
-
445
-
if (launched ??false) {
446
-
print('Successfully opened $uri');
447
-
} else {
448
-
print('Failed to launch $uri');
449
-
}
450
-
} onPlatformException {
451
-
print(
452
-
"There's no activity associated with the file type of this Uri: $uri",
453
-
);
454
-
}
455
-
}
456
-
457
383
Future<void> _openDirectory() async {
458
384
if (_isDirectory) {
459
385
_openFolderFileListPage(_file.uri);
@@ -463,7 +389,7 @@ class _FileExplorerCardState extends State<FileExplorerCard> {
0 commit comments