|
|
|
|
@ -86,12 +86,16 @@ class _AyaRecordWidgetState extends State<AyaRecordWidget> {
|
|
|
|
|
|
|
|
|
|
Future<String> getFilePath() async {
|
|
|
|
|
Directory storageDirectory = await getApplicationDocumentsDirectory();
|
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
|
storageDirectory = await getTemporaryDirectory();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String sdPath = storageDirectory.path + "/record";
|
|
|
|
|
var d = Directory(sdPath);
|
|
|
|
|
if (!d.existsSync()) {
|
|
|
|
|
d.createSync(recursive: true);
|
|
|
|
|
}
|
|
|
|
|
return sdPath + "/test.mp3";
|
|
|
|
|
return sdPath + "/temp${DateTime.now().millisecondsSinceEpoch}.mp3";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -292,8 +296,14 @@ class _AyaRecordWidgetState extends State<AyaRecordWidget> {
|
|
|
|
|
|
|
|
|
|
void saveToPhoneStorage(String filePath) async {
|
|
|
|
|
File file = File(filePath);
|
|
|
|
|
|
|
|
|
|
Directory storageDirectory = await getExternalStorageDirectory();
|
|
|
|
|
Directory storageDirectory;
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
storageDirectory = await getExternalStorageDirectory();
|
|
|
|
|
} else if (Platform.isIOS) {
|
|
|
|
|
storageDirectory = await getApplicationDocumentsDirectory();
|
|
|
|
|
} else {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String storagePath = storageDirectory.path;
|
|
|
|
|
if (storagePath.contains("/Android/data")) {
|
|
|
|
|
|