-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(webapp): show tradingview chart
Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
- Loading branch information
Showing
6 changed files
with
145 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Load file or HTML string example</title> | ||
</head> | ||
<body> | ||
<div class="tradingview-widget-container"> | ||
<div id="tradingview_4418d" style="background-color: white"> | ||
</div> | ||
<div class="tradingview-widget-copyright"> | ||
<a href="https://www.tradingview.com/" rel="noopener nofollow" target="_blank"> | ||
<span class="blue-text">Chart by TradingView.com</span> | ||
</a> | ||
</div> | ||
<script type="text/javascript" src="https://s3.tradingview.com/tv.js"> | ||
</script> | ||
<script type="text/javascript"> | ||
new TradingView.widget({ | ||
"width": "100%", | ||
"symbol": "BITMEX:XBTUSD", | ||
"interval": "D", | ||
"timezone": "Etc/UTC", | ||
"theme": "light", | ||
"style": "1", | ||
"locale": "en", | ||
"widgetbar": true, | ||
"hide_side_toolbar": false, | ||
"toolbar_bg": "#ffffff", | ||
"backgroundColor": "rgb(255,255,255)", | ||
"enable_publishing": false, | ||
"save_image": false, | ||
"container_id": "tradingview_4418d", | ||
"disabled_features": [], | ||
"enabled_features": [], | ||
}); | ||
</script> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; | ||
|
||
enum ProgressIndicatorType { circular, linear } | ||
|
||
class TradingViewWidgetHtml extends StatefulWidget { | ||
const TradingViewWidgetHtml({ | ||
required this.cryptoName, | ||
super.key, | ||
}); | ||
|
||
final String cryptoName; | ||
@override | ||
State<TradingViewWidgetHtml> createState() => _TradingViewWidgetHtmlState(); | ||
} | ||
|
||
class _TradingViewWidgetHtmlState extends State<TradingViewWidgetHtml> { | ||
final GlobalKey webViewKey = GlobalKey(); | ||
InAppWebViewController? webViewController; | ||
double progress = 0; | ||
ProgressIndicatorType type = ProgressIndicatorType.circular; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Column(children: <Widget>[ | ||
Expanded( | ||
child: Stack(children: [ | ||
InAppWebView( | ||
key: webViewKey, | ||
initialFile: "assets/tradingview.html", | ||
onWebViewCreated: (controller) { | ||
webViewController = controller; | ||
}, | ||
), | ||
])), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters