Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:io';
- ),
- shape: new CircleBorder(),
- elevation: 2.0,
- fillColor: pressAttention ? Colors.transparent: Colors.white54,
- padding: const EdgeInsets.all(15.0),
- ),
- ),
- );
- );
- });
- if (controller.value.isRecordingVideo) {
- return null;
- }
- final Directory appDirectory = await getApplicationDocumentsDirectory();
- final String videoDirectory = '${appDirectory.path}/Videos';
- await Directory(videoDirectory).create(recursive: true);
- final String currentTime = DateTime
- .now()
- .millisecondsSinceEpoch
- .toString();
- final String filePath = '$videoDirectory/$currentTime.mp4';
- try {
- await controller.startVideoRecording(filePath);
- videoPath = filePath;
- } on CameraException catch (e) {
- _showCameraException(e);
- return null;
- }
- return filePath;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement