-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send old images to trash instead of nuking them
- Loading branch information
Showing
3 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/services.dart'; | ||
|
||
import 'log.dart'; | ||
|
||
class NativeFileManager { | ||
static const MethodChannel _channel = MethodChannel('io.kbl.alic'); | ||
|
||
static Future<void> trashItem(String filePath) async { | ||
try { | ||
await _channel.invokeMethod('trash', {'filePath': filePath}); | ||
} on PlatformException catch (e) { | ||
log.d("Failed to trash item: '${e.message}'."); | ||
} | ||
} | ||
} | ||
|
||
trash(File file) { | ||
NativeFileManager.trashItem(file.path); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters