adding tests to the flutter results widget - lightly designing it. Added in a testing widget for being able to test widgets without a camera - camera components needs to be updated not to crash the app later though.
Also added real building and testing to the CICD
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
|
||||
// void onNewCameraSelected(CameraDescription cameraDescription) async {
|
||||
// final previousCameraController = controller;
|
||||
// // Instantiating the camera controller
|
||||
// final CameraController cameraController = CameraController(
|
||||
// cameraDescription,
|
||||
// ResolutionPreset.high,
|
||||
// imageFormatGroup: ImageFormatGroup.jpeg,
|
||||
// );
|
||||
//
|
||||
// // Dispose the previous controller
|
||||
// await previousCameraController.dispose();
|
||||
//
|
||||
// // Replace with the new controller
|
||||
// if (mounted) {
|
||||
// setState(() {
|
||||
// controller = cameraController;
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// // Update UI if controller updated
|
||||
// cameraController.addListener(() {
|
||||
// if (mounted) setState(() {});
|
||||
// });
|
||||
//
|
||||
// // Initialize controller
|
||||
// try {
|
||||
// await cameraController.initialize();
|
||||
// } on CameraException catch (e) {
|
||||
// logger.e('Error initializing camera:', e);
|
||||
// }
|
||||
//
|
||||
// // Update the Boolean
|
||||
// if (mounted) {
|
||||
// setState(() {
|
||||
// _isCameraInitialized = controller.value.isInitialized;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// WidgetsBinding.instance.addObserver(this);
|
||||
|
||||
// controller = CameraController(_cameras[0], ResolutionPreset.max);
|
||||
// controller.initialize().then((_) {
|
||||
// if (!mounted) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// setState(() {onNewCameraSelected(_cameras[0]);});
|
||||
// }).catchError((Object e) {
|
||||
// if (e is CameraException) {
|
||||
// switch (e.code) {
|
||||
// case 'CameraAccessDenied':
|
||||
// logger.w('User denied camera access.');
|
||||
// controller.initialize().then((_) {
|
||||
// if (!mounted) {
|
||||
// return;
|
||||
// }
|
||||
// setState(() {});
|
||||
// }).catchError((Object e) {
|
||||
// if (e is CameraException) {
|
||||
// switch (e.code) {
|
||||
// case 'CameraAccessDenied':
|
||||
// logger.i('User denied camera access.');
|
||||
// break;
|
||||
// default:
|
||||
// logger.i('Handle other errors.');
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// break;
|
||||
// default:
|
||||
// logger.i('Handle other errors.');
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
Reference in New Issue
Block a user