Skip to content

Set AppBar in webview.launch(url) #47

@JohannesKaufmann

Description

@JohannesKaufmann

You can't set the AppBar when using launch(url) and if you use the WebviewScaffold you can't access cookies, attach listeners, ...
Would it be possible to add the ability to specify the appbar when launching?
An API that is getting popular in the React community is the so called “render prop”. Would that be possible in dart?

flutterWebviewPlugin.launch(
  url,
  appBar: (state) => new AppBar(...),
);

new WebviewScaffold(
  url: "https://www.google.com",
  appBar: (state) => new AppBar(
    title: new Text(state.url),
  ),
)

state could hold things like url, host, isSecure but also functions like goBack(), close(), goTo(url). This would make it a lot easier to add functionality to the appbar buttons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions