-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Camera Stretching in flutter #34498
Comments
You must provide more information like:
Only with this we can help. |
Hi, I have the same issue.
[✓] Flutter (Channel master, v1.7.4-pre.71, on Mac OS X 10.14.5 18F203, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[!] iOS tools - develop for iOS devices
✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
[✓] Android Studio (version 3.4)
[✓] IntelliJ IDEA Community Edition (version 2019.1.1)
[✓] VS Code (version 1.35.1)
[✓] Connected device (2 available) |
@Loopex2019 I found a workaround that fixes this issue on stackoverflow |
Great I will try . If it succeed , I will tell |
Well no it still the same Issue . I don't really know what to do ? |
@Loopex2019, hmm... Look at my code. It works for me. [✓] Flutter (Channel master, v1.7.9-pre.2, on Mac OS X 10.14.4 18E227, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.35.1)
[✓] Connected device (5 available) @override
Widget build(BuildContext context) {
Widget child = Container();
if (_inited) {
final size = MediaQuery.of(context).size;
final deviceRatio = size.width / size.height;
child = Transform.scale(
scale: _controller.value.aspectRatio / deviceRatio,
child: Center(
child: AspectRatio(
aspectRatio: _controller.value.aspectRatio,
child: CameraPreview(_controller),
),
),
);
}
return WithStatusBarStyle(
child: Scaffold(
backgroundColor: Colors.black,
body: Stack(
fit: StackFit.expand,
children: <Widget>[
child,
// ...
// another UI
// ...
],
),
),
);
} |
And here is my Code : |
Hi there i realized that the StackOverflow Solution only works for The Back Camera not the front one. So it is only solved on the back Camera , the front still the same . |
Thanks for the Support it worked for me fine |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I used the Camera Package and the
CameraPreview()
worked fine for me . But the Problem that it is always stretching on the Android Emulator . So i used a real Android Device and it is always stretching too . Does anybody have an Idea of why is that happening and how to solve it ?The text was updated successfully, but these errors were encountered: