Skip to content

fix bug "A C function pointer can only be formed"#903

Open
anhhtbk wants to merge 1 commit intofluttercommunity:masterfrom
anhhtbk:master
Open

fix bug "A C function pointer can only be formed"#903
anhhtbk wants to merge 1 commit intofluttercommunity:masterfrom
anhhtbk:master

Conversation

@anhhtbk
Copy link
Copy Markdown

@anhhtbk anhhtbk commented Oct 16, 2023

No description provided.

@anhhtbk anhhtbk requested a review from bartekpacia as a code owner October 16, 2023 16:19
Comment thread README.md
Comment on lines +101 to 111
GeneratedPluginRegistrant.register(with: self)
FlutterDownloaderPlugin.setPluginRegistrantCallback { registry in
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin")!)
}
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}

private func registerPlugins(registry: FlutterPluginRegistry) {
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin")!)
}
}

```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How is this code different from the previous one?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The old code will crash with error: "A C function pointer can only be formed from a reference to a 'func' or a literal closure"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants