Skip to content

Instantly share code, notes, and snippets.

@luiscarch11
Created June 27, 2022 19:40
Show Gist options
  • Save luiscarch11/88dae6c43ab45268475b7b5a6d51d3df to your computer and use it in GitHub Desktop.
Save luiscarch11/88dae6c43ab45268475b7b5a6d51d3df to your computer and use it in GitHub Desktop.
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