app_widget_platform_interface 0.4.0 copy "app_widget_platform_interface: ^0.4.0" to clipboard
app_widget_platform_interface: ^0.4.0 copied to clipboard

Common platform interface for app_widget plugin.

app_widget_platform_interface #

Common platform interface for app_widget plugin.

Usage #

To implement a new platform-specific, extend AppWidgetPlatform with a registerWith as static method that set default AppWidgetPlatform.instance = AppWidgetMyPlatform();. And then create another class AppWidgetMyPlatformlugin with an implementation that performs the platform-specific behavior. Finally add your platform initialization in AppWidgetPlugin private constructor to reinstantiate with the platform specific implementation AppWidgetPlatform.instance = AppWidgetMyPlatformPlugin(); when the app run. This is because the plugin registrar will register the first intance before FlutterWidgetBindings.ensureInitialized() and will throw an error if we try to access any methodChannel.

We try to avoid breaking changes at all. Try to reuse the existing interface to keep the api clean whenever possible.

0
likes
140
points
137
downloads

Publisher

verified publishernoxasch.tech

Weekly Downloads

Common platform interface for app_widget plugin.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on app_widget_platform_interface