mirror of
https://github.com/jagandeepbrar/lunasea.git
synced 2026-08-31 04:32:32 +00:00
NEW - [Settings/Modules] Add an information/help button with module descriptions and links TWEAKS - [Radarr] Always show the amount of days content will be available instead of limiting it to only content in the next 30 days - [Settings] Moved "Backup & Restore" and "Logs" to "System" section - [Settings] Merged "Customization" and "Modules" sections into "Configuration" - [Settings/Sonarr] Removed the need to enable Sonarr to test the connection - [Settings/Tautulli] Removed the need to enable Tautulli to test the connection FIXES - [IAPs] Ensure all IAPs are marked as "consumed" - [Flutter] Updated packages - [Logging] Updated Sentry to v4 framework to improve capturing fatal/crashing bugs - [Settings/Logs] Hide exception and stack trace buttons when an error is not available - [Sonarr/History] Fixed history fetching the oldest entries, not the newest - [State] Correctly clear state when clearing LunaSea's configuration - [Tautulli/Activity] Fixed consistency of hardware transcoding indicator compared to the web UI - [UI/Divider] Fix consistency of divider width across regular and AMOLED dark theme
20 lines
800 B
Dart
20 lines
800 B
Dart
import 'dart:io';
|
|
import 'package:share/share.dart';
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
class LunaFileSystem {
|
|
/// Export a given string to the OS-level share sheet with the given name.
|
|
///
|
|
/// Temporarily writes the string as a [File] to the temporary storage directory on the OS.
|
|
///
|
|
/// Temporary storage is eventually cleared by the OS, but is more than enough time to save/send via the share sheet.
|
|
Future<void> exportStringToShareSheet(String name, String data) async {
|
|
Directory tempDirectory = await getTemporaryDirectory();
|
|
String path = '${tempDirectory.path}/$name';
|
|
//Write the NZB to the filesystem
|
|
File file = File(path);
|
|
await file?.writeAsString(data);
|
|
await Share.shareFiles([path]);
|
|
}
|
|
}
|