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

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

Closed
l-k22 opened this issue Nov 9, 2018 · 1 comment
Closed
Labels

Comments

@l-k22
Copy link

l-k22 commented Nov 9, 2018

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)

@slightfoot
Copy link
Member

Please ask on the Flutter Gitter chat for this type of help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants