Skip to content

How to create a Webview with bottom navigation opened from a listview item? #233

@l-k22

Description

@l-k22

I hope someone can help me or point me in the right direction. I have a screen with a tabbedview, on the 3rd tab I have my ebook's content list. When the user clicks a chapter I would like to open a webview to display the html content. However, I require a bottom navigation so that the user can navigate the ebook (the options being, view the content list, bookmark the current page, previous page and next page buttons).
This is an example of my code

return new ListView.builder(
       scrollDirection: Axis.vertical,
         padding:
              new EdgeInsets.fromLTRB(15.0, 0.0, 15.0, 0.0),
         itemCount: chapterList.length + 1,
         itemBuilder: (context, int index) {
              return new FlatButton(
                    onPressed: () =>
                                    flutterWebviewPlugin.launch(chapterList[index].href),
                       child: new Container(
                        width: width,
                        padding: const EdgeInsets.symmetric(vertical: 10.0),
                          child: new Padding(
                            padding: indentAmount(chapterList[index]),
                               child: new Text(
                                 '${chapterList[index].title}',
                                  textAlign: TextAlign.left,
                                   ),
                               ),
                     ));
              });

Row bottomNav(CustomChapterObj chapter) {
    return Row(
        mainAxisSize: MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: <Widget>[
          IconButton(
              icon: Icon(Icons.home, color: Constants.Orange),
              onPressed: () {}),
          IconButton(
              icon: Icon(Icons.view_headline, color: Constants.Orange), //show the content list widget
              onPressed: () {}),
          IconButton(
              icon: Icon(Icons.arrow_back, color: Constants.Orange),
              onPressed: () {}),
          IconButton(
              icon: Icon(Icons.arrow_forward, color: Constants.Orange),
              onPressed: () {}),
          IconButton(
              icon: Icon(Icons.bookmark_border, color: Constants.Orange),
              onPressed: () {}),
        ]);
  }

Many thanks for the great package!

edit: I think I have solved the issue using this method posted in another thread #229 (comment)

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