'Flutter Federated Plugin

I am trying to develop a federated plugin which will wrap a native SDK (for android and ios) as explained here, and also went over the examples shown here and the url_launcher plugin example but nevertheless, I couldn't figure out a few things..

In the documentation there is no example of how to create platform interface package and how it can be used in all platforms of the plugin (The example article and url_launcher shows the web plugin but none of ios and android of the example project uses the platform interface package) and it seems that these examples are old and not updated.

Also, they explain that a platform package should refer the platform interface package in it's pubspec.yaml with the implements definition like this:

flutter:
plugin:
  implements: hello //this refers to the platform interface package
platforms:
  windows:
    pluginClass: HelloPlugin

But I couldn't find any example about this, and how this implements comes in help and how the platform-plugin can use platform-interface-package like explained in the documentation

Is there any good and updated example or tutorial about this topic?



Solution 1:[1]

You should take a look at the flutter plugin url_launcher and other examples from the flutter team. It greatly helped me creating a plugin for each respectful platform.

I found that "implements:" is no more than an indicating with no technical effect.

The documentation says

"Federated platform packages A platform package uses the same format, but includes an implements entry indicating which app-facing package it is an implementation for. For example, a hello_windows plugin containing the Windows implementation for hello would have the following flutter: map:"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris G.