Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. import 'dart:io';
  2.  
  3. ),
  4. shape: new CircleBorder(),
  5. elevation: 2.0,
  6. fillColor: pressAttention ? Colors.transparent: Colors.white54,
  7. padding: const EdgeInsets.all(15.0),
  8. ),
  9. ),
  10. );
  11.  
  12. );
  13. });
  14.  
  15. if (controller.value.isRecordingVideo) {
  16. return null;
  17. }
  18. final Directory appDirectory = await getApplicationDocumentsDirectory();
  19. final String videoDirectory = '${appDirectory.path}/Videos';
  20. await Directory(videoDirectory).create(recursive: true);
  21. final String currentTime = DateTime
  22. .now()
  23. .millisecondsSinceEpoch
  24. .toString();
  25. final String filePath = '$videoDirectory/$currentTime.mp4';
  26. try {
  27. await controller.startVideoRecording(filePath);
  28. videoPath = filePath;
  29. } on CameraException catch (e) {
  30. _showCameraException(e);
  31. return null;
  32. }
  33. return filePath;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement