-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] black screen when using camera and no photos listed #480
[BUG] black screen when using camera and no photos listed #480
Comments
Here is the code i used: _uploadImage() async {
final List<AssetEntity>? assets = await AssetPicker.pickAssets(context,
pickerConfig: AssetPickerConfig(
requestType: RequestType.image,
specialItemPosition: SpecialItemPosition.prepend,
specialItemBuilder: (
BuildContext context,
AssetPathEntity? path,
int length,
) {
if (path?.isAll != true) {
return null;
}
return Semantics(
label: 'Take a picture',
button: true,
onTapHint: 'Take a picture',
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () async {
Feedback.forTap(context);
final AssetEntity? result =
await CameraPicker.pickFromCamera(context,
pickerConfig:
CameraPickerConfig(
textDelegate:
EnglishCameraPickerTextDelegate()));
if (result == null) {
return;
}
final AssetPicker<AssetEntity, AssetPathEntity> picker =
context.findAncestorWidgetOfExactType()!;
final DefaultAssetPickerBuilderDelegate builder =
picker.builder as DefaultAssetPickerBuilderDelegate;
final DefaultAssetPickerProvider p = builder.provider;
await p.switchPath(p.currentPath!);
p.selectAsset(result);
},
child: const Center(
child: Icon(Icons.camera_enhance, size: 42.0),
),
),
);
},
));
if (assets != null) { |
Encountered the same problem, have you resolved it? |
@ejbdobp Can you verify if the problem exist when you use the camera picker alone? |
the error was from our customer. we tested on the same iphone 13 device and it worked fine and we are not able to replicate the error. however the problem is still present on the customers phone. Hi @zhangshuqi, could you give more information on your error? |
ill create a project with camera picker alone please wait |
Hi @AlexV525 i think the closest i can replicate the issue for the camera picker is using the example project on Nexus 5x API 30 simulator, repeatedly tapping "Taking photos" example and tapping close on the camera. what happens is it will get to a black screen with the close, flash and rotate controls gone (only the main take photo button is left and is untappable) However on a real android device, it happened this morning, that the black screen appeared on first use of camera picker, it froze and there is nothing to do. the user has to tap back and restart the camera for it to work. here is the screenshot. this only happened on first use of the app. for the customer i mentioned above, the black screen always appear and the camera never works despite the permissions enabled. |
So I guess it's a camera picker issue. Could you identify if fluttercandies/flutter_wechat_camera_picker#191 can fix your case? |
Describe the bug
Black screen when loading images, the folders can be accessed but the photos are not appearing. When camera picker is selected the app freezes
How to reproduce
Only iphone 13 displays this erratic behavior, when using the same app with android it works alright. Tested with iphone 7 and 11 and there is no issue
The permissions are enabled
Any idea what could be the problem?
Version information
The text was updated successfully, but these errors were encountered: