This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Commit 6fad27b
authored
[macOS] Consolidate view management (#52254)
This PR improves view management logic of the macOS `FlutterEngine`
class.
* View operation assertions are now centralized in
`registerViewController:` and `deregisterViewControllerForIdentifier:`.
* `addViewController` now directly calls `.viewController =` on implicit
views, so that it matches its verbatim description.
* The doc for `addViewController` correctly reflects the fact that it
doesn't support multiple views yet.
Additionally, a useless (for now) member variable is removed.
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I signed the [CLA].
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat1 parent 7141730 commit 6fad27b
File tree
2 files changed
+32
-35
lines changed- shell/platform/darwin/macos/framework/Source
2 files changed
+32
-35
lines changedLines changed: 28 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | 459 | | |
463 | 460 | | |
464 | 461 | | |
| |||
515 | 512 | | |
516 | 513 | | |
517 | 514 | | |
518 | | - | |
519 | | - | |
520 | 515 | | |
521 | 516 | | |
522 | 517 | | |
| |||
736 | 731 | | |
737 | 732 | | |
738 | 733 | | |
739 | | - | |
740 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
741 | 738 | | |
742 | 739 | | |
| 740 | + | |
743 | 741 | | |
744 | 742 | | |
745 | 743 | | |
746 | 744 | | |
747 | | - | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
748 | 753 | | |
749 | 754 | | |
750 | 755 | | |
| |||
779 | 784 | | |
780 | 785 | | |
781 | 786 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
786 | 796 | | |
| 797 | + | |
787 | 798 | | |
788 | 799 | | |
789 | 800 | | |
| |||
877 | 888 | | |
878 | 889 | | |
879 | 890 | | |
880 | | - | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
895 | 896 | | |
896 | 897 | | |
897 | 898 | | |
898 | | - | |
899 | | - | |
900 | 899 | | |
901 | 900 | | |
902 | 901 | | |
| |||
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
| |||
0 commit comments