-
Notifications
You must be signed in to change notification settings - Fork 5.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
[macOS] Revise the doc for FlutterViewController initializers #52242
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -84,13 +84,26 @@ FLUTTER_DARWIN_EXPORT | |||||
@property(nonatomic) FlutterMouseTrackingMode mouseTrackingMode; | ||||||
|
||||||
/** | ||||||
* Initializes a controller that will run the given project. | ||||||
* Initializes this `FlutterViewController` for the implicit view of a new | ||||||
* `FlutterEngine`. | ||||||
* | ||||||
* This initializer is a shorthand for creating an engine explicitly and | ||||||
* initializing with `initWithEngine:nibName:bundle:`. | ||||||
* | ||||||
* Since the created engine is only referred by this view controller, once thie | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* view controller is deallocated, the engine will be shut down, unless anther | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* strong referrence to the engine is kept. It is recommended to use | ||||||
* `initWithEngine:nibName:bundle:` if the app's implicit view might be closed | ||||||
* at some point, such as running headlessly. | ||||||
* | ||||||
* The engine holds a weak reference to the view controller, while the view controller | ||||||
* holds a strong reference to the engine. | ||||||
* | ||||||
* In this initializer, this controller creates an engine, and is attached to | ||||||
* that engine as the default controller. In this way, this controller can not | ||||||
* be set to other engines. This initializer is suitable for the first Flutter | ||||||
* view controller of the app. To use the controller with an existing engine, | ||||||
* use initWithEngine:nibName:bundle: instead. | ||||||
* For an introduction to implicit views, see | ||||||
* [PlatformDispatcher.implicitView](https://api.flutter.dev/flutter/dart-ui/PlatformDispatcher/implicitView.html). | ||||||
* | ||||||
* There isn't a way to create a `FlutterViewController` that's not attached | ||||||
* to an engine. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be on this doc? I would consider removing this. |
||||||
* | ||||||
* @param project The project to run in this view controller. If nil, a default `FlutterDartProject` | ||||||
* will be used. | ||||||
|
@@ -103,12 +116,11 @@ FLUTTER_DARWIN_EXPORT | |||||
NS_DESIGNATED_INITIALIZER; | ||||||
- (nonnull instancetype)initWithCoder:(nonnull NSCoder*)nibNameOrNil NS_DESIGNATED_INITIALIZER; | ||||||
/** | ||||||
* Initializes this FlutterViewController with an existing `FlutterEngine`. | ||||||
* | ||||||
* The initialized view controller will add itself to the engine as part of this process. | ||||||
* Initializes this FlutterViewController as attached to an existing | ||||||
* `FlutterEngine`. | ||||||
* | ||||||
* This initializer is suitable for both the first Flutter view controller and | ||||||
* the following ones of the app. | ||||||
* The engine holds a weak reference to the view controller, while the view controller | ||||||
* holds a strong reference to the engine. | ||||||
* | ||||||
* @param engine The `FlutterEngine` instance to attach to. Cannot be nil. | ||||||
* @param nibName The NIB name to initialize this controller with. | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the original sentence here:
I don't think we're ready yet to expose the implicit view to the user. This isn't something folks have needed to know about today. Could we punt this "implicit view" messaging until we're ready to migrate folks off the implicit view?