Dart Flutter export share JSON file or any file you like.
This article explains how to export a text content, json list or object in an flutter application to the device. See the following image for a preview.

Here we used the following code:
import 'dart:convert';
import 'package:share_plus/share_plus.dart';
import 'package:path_provider/path_provider.dart';
import 'dart:io';
import 'package:intl/intl.dart';Future convertStringToFileShare(BuildContext context, String imputListAsString) async {
var filename = 'reperti_2022.par';
final temp = await getTemporaryDirectory();
final path = '${temp.path}/${filename}';
File(path).writeAsString(imputListAsString);
await Share.shareFiles([path]);
}void main() { var fileContent = '{"text":"here is the content of the file"}';
convertStringToFileShare(fileContent);}// call the function with the following command
// convertStringToFileShare("file content");
After you run the code the file explorer of the device should open and the user can choose the location of the file.

After the user confirmed with save the file should be in the chosen directory.
I hope the article helped. Happy coding.