media.dart 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. /// 媒体服务模块
  2. ///
  3. /// 提供统一的图片选择、拍照、压缩和处理功能
  4. ///
  5. /// 使用示例:
  6. /// ```dart
  7. /// import 'package:sino_med_cloud/media/media.dart';
  8. ///
  9. /// // 快捷方式:从相册选择并自动压缩
  10. /// final file = await MediaService.pickFromGallery();
  11. ///
  12. /// // 快捷方式:使用系统相机拍照并自动压缩
  13. /// final photo = await MediaService.pickFromCamera();
  14. ///
  15. /// // 专业相机(需要手动管理生命周期)
  16. /// final cameraService = CameraService();
  17. /// await cameraService.init();
  18. /// final photo = await cameraService.takePicture();
  19. /// cameraService.dispose();
  20. ///
  21. /// // 图片处理
  22. /// final compressed = await MediaService.compressImage(photo!);
  23. /// final info = await MediaService.getImageInfo(compressed);
  24. /// final cleaned = await MediaService.removeExif(compressed);
  25. /// ```
  26. library media;
  27. export 'media_service.dart';
  28. export 'picker_service.dart';
  29. export 'camera_service.dart';
  30. export 'image_processor.dart';
  31. export 'media_exception.dart';