Fix export for macOS & iPadOS, resolves #196

This commit is contained in:
Neeraj Gupta
2023-08-13 10:01:12 +05:30
parent c8e8240540
commit edc1023caf

View File

@@ -134,7 +134,8 @@ Future<void> _exportCodes(BuildContext context, String fileContent) async {
await _codeFile.delete();
}
_codeFile.writeAsStringSync(fileContent);
await Share.shareFiles([_codeFile.path]);
final Size size = MediaQuery.of(context).size;
await Share.shareFiles([_codeFile.path], sharePositionOrigin: Rect.fromLTWH(0, 0, size.width, size.height / 2),);
Future.delayed(const Duration(seconds: 15), () async {
if (_codeFile.existsSync()) {
_codeFile.deleteSync();