Line data Source code
1 : // Copyright 2023 The terCAD team. All rights reserved. 2 : // Use of this source code is governed by a CC BY-NC-ND 4.0 license that can be found in the LICENSE file. 3 : 4 : import 'dart:io'; 5 : 6 : import 'package:app_finance/_classes/herald/app_locale.dart'; 7 : import 'package:file_picker/file_picker.dart'; 8 : 9 : mixin FileExportMixin { 10 0 : Future<void> exportFile(List<int> codeUnits, String filename) async { 11 0 : final path = await FilePicker.platform.saveFile(dialogTitle: AppLocale.labels.outputFile, fileName: filename); 12 : if (path != null) { 13 0 : final saveFile = File(path); 14 0 : await saveFile.writeAsBytes(codeUnits); 15 : } 16 : } 17 : }