diff --git a/lib/webview.dart b/lib/webview.dart index d98a582..3ae4cc1 100644 --- a/lib/webview.dart +++ b/lib/webview.dart @@ -159,33 +159,58 @@ class _WebViewContainerState extends State { }, ) ]), - body: Column( - children: [ - Expanded( - child: Stack( - children: [ - WebViewWidget(controller: _controller), - new Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onHorizontalDragEnd: _settleLeft, - child: Container( - width: _kEdgeDragWidth, - color: Colors.transparent, - ), + body: Container( + child: Column(children: [ + Expanded( + child: Stack( + children: [ + WebViewWidget(controller: _controller), + new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onHorizontalDragEnd: _settleLeft, + child: Container( + width: _kEdgeDragWidth, + color: Colors.transparent, + ), + ), + GestureDetector( + onHorizontalDragEnd: _settleRight, + child: Container( + width: _kEdgeDragWidth, + color: Colors.transparent, ), - GestureDetector( - onHorizontalDragEnd: _settleRight, - child: Container( - width: _kEdgeDragWidth, - color: Colors.transparent, - ), - ) - ]) + ) + ]) + ], + )), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + TextButton.icon( + onPressed: () { + _controller.canGoBack().then((onValue) { + if (onValue) _controller.goBack(); + }); + }, + icon: Icon(Icons.arrow_back), + label: Text('Back'), + ), + // Forward button with icon on right end + TextButton.icon( + onPressed: () { + _controller.canGoForward().then((onValue) { + if (onValue) _controller.goForward(); + }); + }, + label: Text('Forward'), + icon: Icon(Icons.arrow_forward), + ), ], - )) - ], - )); + ), + ) + ]))); } }