Commit b42821b
Changed files (2)
lib
platform_integration
screens
lib/platform_integration/platform_client.dart
@@ -4,8 +4,13 @@ class PlatformClient {
/// Platform channel for sharing files, loading files, saving files and asking for directory permissions.
static const storagePlatform = MethodChannel('bloodPressureApp.derdilla.com/storage');
-
- static Future<bool> shareFile(String path, String mimeType) async { // TODO: arguments from platform
+ /// Share a file from application storage.
+ ///
+ /// The file present at the [path] specified will be copied to a sharable location. The file in the sharable location
+ /// will be shared with the specified [mimeType].
+ ///
+ /// The user will be shown the Android Sharesheet.
+ static Future<bool> shareFile(String path, String mimeType) async {
try {
await storagePlatform.invokeMethod('shareFile', {
'path': path,
lib/screens/error_reporting.dart
@@ -100,7 +100,7 @@ class ErrorScreen extends StatelessWidget {
assert(dbPath != inMemoryDatabasePath);
dbPath = join(dbPath, 'blood_pressure.db');
- PlatformClient.shareFile(dbPath, 'application/vnd.sqlite3'); // TODO: test
+ PlatformClient.shareFile(dbPath, 'application/vnd.sqlite3');
} catch(e) {
scaffoldMessenger.showSnackBar(SnackBar(
content: Text('ERR: ${e.toString()}')));