camera_engine.dart 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // import 'package:flutter/material.dart';
  2. // import 'package:wechat_camera_picker/wechat_camera_picker.dart';
  3. // import 'package:flutter/services.dart';
  4. // import 'package:get/get.dart';
  5. //
  6. // /*
  7. // * 照相机的引擎封装,目前用的 CameraPicker 插件
  8. // */
  9. // class CameraEngine {
  10. // /// 拍照
  11. // static Future<AssetEntity?> takePhoto(BuildContext context) async {
  12. // return await CameraPicker.pickFromCamera(
  13. // context,
  14. // pickerConfig: CameraPickerConfig(
  15. // enableRecording: false,
  16. // theme: ThemeData(
  17. // brightness: Brightness.dark,
  18. // appBarTheme: AppBarTheme(
  19. // systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith(
  20. // statusBarColor: Colors.transparent,
  21. // statusBarBrightness: Brightness.dark,
  22. // statusBarIconBrightness: Brightness.light,
  23. // ),
  24. // ),
  25. // ),
  26. // ),
  27. // );
  28. // }
  29. //
  30. // /// 录制视频
  31. // static Future<AssetEntity?> takeVideo(
  32. // BuildContext context, {
  33. // int maxRecordInSeconds = 30,
  34. // }) async {
  35. // return await CameraPicker.pickFromCamera(
  36. // context,
  37. // pickerConfig: CameraPickerConfig(
  38. // enableRecording: true,
  39. // onlyEnableRecording: true,
  40. // enableTapRecording: false,
  41. // enableAudio: true,
  42. // shouldAutoPreviewVideo: true,
  43. // maximumRecordingDuration: Duration(seconds: maxRecordInSeconds),
  44. // theme: ThemeData(
  45. // brightness: Brightness.dark,
  46. // appBarTheme: AppBarTheme(
  47. // systemOverlayStyle: SystemUiOverlayStyle.dark.copyWith(
  48. // statusBarColor: Colors.transparent,
  49. // statusBarBrightness: Brightness.dark,
  50. // statusBarIconBrightness: Brightness.light,
  51. // ),
  52. // ),
  53. // ),
  54. // ),
  55. // );
  56. // }
  57. // }