saveFile static method

Future<String?> saveFile(
  1. String fileName,
  2. String fileType
)

Implementation

static Future<String?> saveFile(String fileName, String fileType) async {
  String? path = '';
  try {
    path = await FilePicker.platform.saveFile(
      fileName: '$fileName.$fileType',
      type: FileType.custom,
      allowedExtensions: [fileType]
    );
  }
  on PlatformException catch (e) {
    console.error('Unsupported operation Select: $e');
  }
  catch (e) {
    console.error('Select: $e');
  }
  return path;
}