Skip to content

[camerax] Change buildPreview to return Texture versus FutureBuilder#6021

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
camsim99:camx_setState
Feb 1, 2024
Merged

[camerax] Change buildPreview to return Texture versus FutureBuilder#6021
auto-submit[bot] merged 2 commits into
flutter:mainfrom
camsim99:camx_setState

Conversation

@camsim99

@camsim99 camsim99 commented Jan 31, 2024

Copy link
Copy Markdown
Contributor

Changes the buildPreview implementation to return a Texture versus a FutureBuilder that would ultimately return that same Texture.

The FutureBuilder depended on checking a condition that should be true by default assuming createCamera was called prior. This seems to be an assumption made consistently across other platform implementations (including camera_android-- see source), so this PR is achieving consistency with them.

Fixes flutter/flutter#140567. Thanks to @davidmartos96 for the push to investigate deeper on that issue!

Pre-launch Checklist

@camsim99 camsim99 requested review from a team and bparrishMines January 31, 2024 20:33
@@ -1,3 +1,8 @@
## 0.5.0+29

* Modifies `buildPreview` to return `Texture` that maps to camera preview, building in the assumption

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider linking to the issue that is being fixed.

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 1, 2024
@auto-submit auto-submit Bot merged commit 450251a into flutter:main Feb 1, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 2, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 2, 2024
auto-submit Bot pushed a commit to flutter/flutter that referenced this pull request Feb 2, 2024
flutter/packages@5b48c44...d37fb0a

2024-02-02 32242716+ricardoamador@users.noreply.github.com Add a link the different possible Android virtual device configs (flutter/packages#6033)
2024-02-01 32242716+ricardoamador@users.noreply.github.com Update the emulator versions and expose cipd. (flutter/packages#6025)
2024-02-01 stuartmorgan@google.com [tool] Add details to missing gradle coverage error (flutter/packages#6029)
2024-02-01 stuartmorgan@google.com [file_selector] Fix comment typo (flutter/packages#6027)
2024-02-01 43054281+camsim99@users.noreply.github.com [camerax] Change `buildPreview` to return `Texture` versus `FutureBuilder` (flutter/packages#6021)
2024-02-01 engine-flutter-autoroll@skia.org Manual roll Flutter from c65ab4d to e02e207 (38 revisions) (flutter/packages#6028)
2024-02-01 engine-flutter-autoroll@skia.org Manual roll Flutter from 75a2e5b to c65ab4d (22 revisions) (flutter/packages#6026)
2024-02-01 engine-flutter-autoroll@skia.org Roll Flutter from ace9181 to 75a2e5b (16 revisions) (flutter/packages#6017)
2024-02-01 JeroenWeener@users.noreply.github.com [webview_flutter] Support for handling basic authentication requests (flutter/packages#5727)
2024-01-31 stuartmorgan@google.com [tool] Extend `flutter test` workaround to other desktops (flutter/packages#6024)
2024-01-31 katelovett@google.com [two_dimensional_scrollables] Merged cells for TableView (flutter/packages#5917)
2024-01-31 tessertaha@gmail.com [rfw] Restore RFW to 100% coverage after `ButtonBar` update (flutter/packages#6020)
2024-01-31 louisehsu@google.com [in_app_purchase] Convert storefront(), transactions(), canMakePayment(), and addPayment() to pigeon (flutter/packages#5910)
2024-01-31 reidbaker@google.com [in_app_purchase] Add play country code api (flutter/packages#5941)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…lder` (flutter#6021)

Changes the `buildPreview` implementation to return a `Texture` versus a `FutureBuilder` that would ultimately return that same `Texture`.

The `FutureBuilder` depended on checking a condition that should be true by default assuming `createCamera` was called prior. This seems to be an assumption made consistently across other platform implementations (including `camera_android`-- see [source](https://github.com/flutter/packages/blob/7b1ae1f4cceea02f330716e701c6dcd9f0ca3f7e/packages/camera/camera_android/lib/src/android_camera.dart#L520)), so this PR is achieving consistency with them.

Fixes flutter/flutter#140567. Thanks to @davidmartos96 for the push to investigate deeper on that issue!
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…lder` (flutter#6021)

Changes the `buildPreview` implementation to return a `Texture` versus a `FutureBuilder` that would ultimately return that same `Texture`.

The `FutureBuilder` depended on checking a condition that should be true by default assuming `createCamera` was called prior. This seems to be an assumption made consistently across other platform implementations (including `camera_android`-- see [source](https://github.com/flutter/packages/blob/7ae65cc09cc1d6af72c6429bcf4802c76668652e/packages/camera/camera_android/lib/src/android_camera.dart#L520)), so this PR is achieving consistency with them.

Fixes flutter/flutter#140567. Thanks to @davidmartos96 for the push to investigate deeper on that issue!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: camera

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[camerax] Preview flickering when calling setState

2 participants