cuttle/mobile/lib/utils/file_utils.dart

15 lines
535 B
Dart
Raw Normal View History

import 'dart:io';
import 'package:camerawesome/camerawesome_plugin.dart';
import 'package:path_provider/path_provider.dart';
Future<String> path(CaptureMode captureMode) async {
final Directory extDir = await getTemporaryDirectory();
final testDir =
await Directory('${extDir.path}/test').create(recursive: true);
final String fileExtension = captureMode == CaptureMode.photo ? 'jpg' : 'mp4';
final String filePath =
'${testDir.path}/${DateTime.now().millisecondsSinceEpoch}.$fileExtension';
return filePath;
}