Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Replaces the code that used the key window's root view controller with a call to the new registrar viewController method to get the actual Flutter content's view controller.

Introduces the same protocol abstraction now used in a number of our plugins, so that a stub can be injected without having to mock (which would be a barrier to Swift migration) or fake (which is fragile since it would have to be complete, and methods can be added over time) the entire Flutter plugin registrar.

Fixes flutter/flutter#174418

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Replaces the code that used the key window's root view controller with a
call to the new registrar viewController method to get the actual
Flutter content's view controller.

Introduces the same protocol abstraction now used in a number of our
plugins, so that a stub can be injected without having to mock (which
would be a barrier to Swift migration) or fake (which is fragile since
it would have to be complete, and methods can be added over time) the
entire Flutter plugin registrar.

Fixes flutter/flutter#174418
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the image_picker_ios plugin to improve UIScene compatibility by abstracting view controller access behind a FIPViewProvider protocol. This is a solid approach that also improves testability. The changes are mostly correct, but I've found a critical issue where many tests were not updated to use the new initializer, potentially masking issues and reducing test effectiveness. I've also included a couple of minor suggestions for improving code style and robustness.

Copy link
Contributor

@vashworth vashworth left a comment

Choose a reason for hiding this comment

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

LGTM with a question: #10677 (comment)

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 6, 2026
@auto-submit auto-submit bot merged commit 40f248d into flutter:main Jan 6, 2026
81 checks passed
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: image_picker platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[image_picker_ios][UIScene] Migrate to scene APIs

2 participants