mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 14:08:55 +03:30
add export cycles
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import '../config/urls.dart';
|
||||
import '../config/user.dart';
|
||||
@@ -383,4 +385,19 @@ class CyclesProvider extends ChangeNotifier {
|
||||
// };
|
||||
return result!;
|
||||
}
|
||||
|
||||
Future<bool> exportCycles() async {
|
||||
final baseStorage = await getExternalStorageDirectory();
|
||||
final taskId = await FlutterDownloader.enqueue(
|
||||
url: Url.exportCycles,
|
||||
savedDir: baseStorage!.path,
|
||||
headers: {'Authorization': User.token, "Accept": "*"},
|
||||
showNotification: true,
|
||||
openFileFromNotification: true,
|
||||
saveInPublicStorage: true,
|
||||
fileName: "Cycles " + DateTime.now().toString() + ".xlsx",
|
||||
);
|
||||
print(taskId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user