Skip to content

Commit

Permalink
수정함
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphanoJack committed Aug 17, 2024
1 parent 85c44d5 commit 6cdff08
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 79 deletions.
2 changes: 1 addition & 1 deletion lib/feature/camera/CameraScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ class CameraScreen extends StatelessWidget {
Widget build(BuildContext context) {
return const CameraPageWidget();
}
}
}
78 changes: 0 additions & 78 deletions lib/feature/camera/service/CameraService.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,81 +90,3 @@ class CameraService {
readyTakePhotoNotifier.dispose();
}
}

// class CameraService {
// CameraController? controller;
// List<CameraDescription> cameras = [];
// bool _readyTakePhoto = false;
// final bool _changeCamera = false;
//
//
// bool get readyTakePhoto => _readyTakePhoto;
// bool get changeCamera => _changeCamera;
//
// Future<void> initializeCameras() async {
// cameras = await availableCameras();
// controller = CameraController(cameras[0], ResolutionPreset.high);
// await controller!.initialize();
// }
//
// Future<void> toggleCamera() async {
// if (cameras.length < 2) return;
//
// final lensDirection = controller!.description.lensDirection;
// CameraDescription newCamera;
// if (lensDirection == CameraLensDirection.back) {
// newCamera = cameras.firstWhere(
// (camera) => camera.lensDirection == CameraLensDirection.front,
// );
// } else {
// newCamera = cameras.firstWhere(
// (camera) => camera.lensDirection == CameraLensDirection.back,
// );
// }
//
// await controller?.dispose();
// controller = CameraController(newCamera, ResolutionPreset.high);
// try {
// await controller!.initialize();
// _readyTakePhoto = true;
// } catch (e) {
// print("Error toggling camera: $e");
// _readyTakePhoto = false;
// }
// }
//
// Future<XFile?> takePhoto() async {
// if (controller != null && controller!.value.isInitialized) {
// try {
// final XFile file = await controller!.takePicture();
// return file;
// } catch (e) {
// print("Error taking photo: $e");
// return null;
// }
// }
// return null;
// }
//
// void attemptTakePhoto(BuildContext context) async {
// final String timeInMilli = DateTime.now().millisecondsSinceEpoch.toString();
// try {
// final path = join((await getTemporaryDirectory()).path, '$timeInMilli.png');
// final XFile file = await controller!.takePicture();
// await file.saveTo(path);
// final File imageFile = File(path);
//
// if (context.mounted) {
// Navigator.of(context).push(
// MaterialPageRoute(builder: (_) => CameraPreviewScreen(imageFile)),
// );
// }
// } catch (e) {
// print('Error: $e');
// }
// }
//
// void dispose() {
// controller!.dispose();
// }
// }

0 comments on commit 6cdff08

Please sign in to comment.