Created
June 27, 2022 19:40
-
-
Save luiscarch11/88dae6c43ab45268475b7b5a6d51d3df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onPressed: () async { | |
img.Image copyRotate(img.Image? image) { | |
return img.copyRotate(image!, 90); | |
} | |
CustomDialogs.loadingDialog(context: context); | |
img.Image fixedImage; | |
final capturedImage = await compute(img.decodeImage, state.model.backImage!); | |
fixedImage = await compute(copyRotate, capturedImage); | |
final Uint8List fixedFile = Uint8List.fromList(await compute(img.encodeJpg, fixedImage)); | |
context.read<VaccineVerificationBloc>().add(UpdateModelVaccineEvent( | |
typeFile: state.model.typeFile!, isWeb: state.model.isWeb, backImage: fixedFile)); | |
// Close Loading | |
Navigator.pop(context); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment