-
Notifications
You must be signed in to change notification settings - Fork 607
[linux] Align C++ plugin structure with Flutter #183
[linux] Align C++ plugin structure with Flutter #183
Conversation
|
Note: please wait for me to land this rather than landing it once it's approved, because it's a breaking change for PR #161 and I have a patch I'll want to push there at the same time as landing this. |
124214e to
f3fd1e0
Compare
|
Rebased to account for 161 (now depends on #194) |
Eliminates Plugin as the primary interface point, and instead moves to a MethodChannel-based model. This eliminates the need for void* types in the interfaces, allowing a move to full type safety (via templates) for all the classes related to channels. Additionally, the plugin creation and registration system now matches the Flutter structure on iOS and Android, using static registration of a plugin class with a PluginRegistrar. The desktop registrar currently has minimal functionality, but it can be extended over time. This is collapsed into one large patch in order to minimize the number of API-breaking changes.
69f6943 to
45f9dd2
Compare
franciscojma86
left a comment
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.
LGTM with a few nits
library/include/flutter_desktop_embedding/engine_method_result.h
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| // PluginRegistrar: | ||
|
|
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.
Remove extra line?
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.
It's a heading for both of the following methods, so I separated it so that it doesn't appear to be associated only with AddPlugin.
Eliminates Plugin as the primary interface point, and instead moves to a
MethodChannel-based model. This eliminates the need for void* types in
the interfaces, allowing a move to full type safety (via templates) for
all the classes related to channels.
Additionally, the plugin creation and registration system now matches
the Flutter structure on iOS and Android, using static registration of a
plugin class with a PluginRegistrar. The desktop registrar currently has
minimal functionality, but it can be extended over time.
This is a breaking change for any Plugin implementation, as well as
application-level code that was calling AddPlugin. It is collapsed into
one large patch in order to minimize the number of API-breaking changes.
This essentially completes issue #102 for Linux.