camera method
Implementation
camera(BuildContext context) async {
if (!availableFeatures.value.isGroupChatAvailable.checkNull()) {
Helper.showFeatureUnavailable(context);
return;
}
if (await AppUtils.isNetConnected()) {
final XFile? photo = await _picker.pickImage(source: ImageSource.camera);
if (photo != null) {
/*Get.to(CropImage(
imageFile: File(photo.path),
))?.then((value) {*/
if (context.mounted) {
Navigator.push(
context,
MaterialPageRoute(
builder: (con) => CropImage(
imageFile: File(photo.path),
))).then((value) {
value as MemoryImage;
var name = "${DateTime.now().millisecondsSinceEpoch}.jpg";
writeImageTemp(value.bytes, name).then((value) {
imagePath(value.path);
updateGroupProfileImage(value.path, context);
});
});
}
} else {
// User canceled the Camera
}
} else {
toToast(AppConstants.noInternetConnection);
}
}