takePhotoOrVideo static method

Future<AssetEntity?> takePhotoOrVideo(
  1. BuildContext context
)

拍照 or 拍视频

Implementation

static Future<AssetEntity?> takePhotoOrVideo(BuildContext context) async {
  final AssetEntity? asset = await CameraPicker.pickFromCamera(
    context,
    enableRecording: true, //是否可以录像
    resolutionPreset: ResolutionPreset.high,
    maximumRecordingDuration: const Duration(seconds: 10),
    theme: CameraPicker.themeData(HColors.app_accent_5A46BE),
  );
  return asset;
}