Last active
October 18, 2018 15:28
-
-
Save benoitjadinon/f79a1d49b038862774913e73d596edbb to your computer and use it in GitHub Desktop.
TradingView Chart Dart JS Interop
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
@JS() | |
library tv.js; | |
import "package:js/js.dart"; | |
@JS("TradingView.widget") | |
class widget { | |
external factory widget(WidgetOptions options); | |
} | |
@anonymous | |
@JS() | |
class WidgetOptions | |
{ | |
external String get symbol; | |
external set symbol(String b); | |
external String get container_id; | |
external set container_id(String b); | |
external bool get autosize; | |
external set autosize(bool b); | |
external String get interval; | |
external set interval(String b); | |
} |
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
import 'TradingView.dart' as tv; | |
tv.widget ( | |
new tv.WidgetOptions() | |
..container_id = 'tv_chart_container' | |
..autosize = true | |
..symbol = "COINBASE:BTCUSD" | |
..interval = "D" | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment