Skip to content

Implement new method channels to avoid warnings #669

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

Merged

Conversation

bltavares
Copy link
Contributor

Since the upgrade to Flutter 3.0 there were new method channels introduced.

This commit implement a couple of them, to reduce the amount of warnings when running the project.

Fixes #667

Since the upgrade to Flutter 3.0 there were new method channels introduced.

This commit implement a couple of them, to reduce the amount of warnings when running the project.

Fixes go-flutter-desktop#667
@bltavares bltavares force-pushed the flutter-3-method-channels branch from 8558294 to bf98504 Compare July 22, 2022 18:00
func (p *restorationPlugin) InitPlugin(messenger plugin.BinaryMessenger) error {
channel := plugin.NewMethodChannel(messenger, "flutter/restoration", plugin.StandardMethodCodec{})
// Currently not supported. Used only to avoid warnings.
channel.HandleFunc("get", func(_ interface{}) (interface{}, error) { return nil, nil })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this, desktop CAN support restoration so it's better to either:

  • Implement it
  • Leave the warning

Copy link
Member

@pchampio pchampio Jul 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm, acutally, I don't know if this is a feature for desktop: https://api.flutter.dev/flutter/services/RestorationManager-class.html

Mobile operating systems use the concept of state restoration to provide the illusion that apps continue to run in the background forever

What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's not intended for desktop

Copy link
Member

@pchampio pchampio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pchampio pchampio merged commit f538461 into go-flutter-desktop:master Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

no handler found for channel flutter/restoration
3 participants