Skip to content
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

Multiple provider / widget support #6

Open
noxasch opened this issue Sep 19, 2022 · 4 comments
Open

Multiple provider / widget support #6

noxasch opened this issue Sep 19, 2022 · 4 comments
Labels
android enhancement New feature or request

Comments

@noxasch
Copy link
Owner

noxasch commented Sep 19, 2022

Currently multiple widget of the same provider works just fine. This is to support multiple widget types on Android.

@noxasch noxasch added enhancement New feature or request android labels Sep 19, 2022
@noxasch
Copy link
Owner Author

noxasch commented Sep 27, 2022

What need to be done:

  • To support un-configurable widget, we need to expose widget onUpdate as a callback that trigger an isolate in the background since widget provider can't communicate with mainActivity.

  • To support multiple configurable widget, we can't use CONFIGURE_WIDGET intent as it doesn't include the widget layout. Instead implement a default onClick callback on the widget during the first onUpdate/onEnabled callback. This callback will then return the widgetId and layout name to the configuration screen/activity.

@noxasch
Copy link
Owner Author

noxasch commented Oct 4, 2022

Another option to try is to use another activity similar to how we handle this in Android. This activity should return the appropriate widget id and layout name when flutter engine is ready.

NOTE: not sure if using multiple activity will have any effect on the flutter app since each activity call the same flutter app.

@noxasch
Copy link
Owner Author

noxasch commented Apr 26, 2024

Update:

  • expose layoutId and layout name is planned in v0.4.0 in both configureWidget and updateWidget

with this implementation theoretically we can support widget with different layout without much works.

@noxasch
Copy link
Owner Author

noxasch commented Apr 26, 2024

to be verify in v0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant