I could show my Slack Chatbot written in Dart. It covers websockets, an API w/ redstone and a little bit AngularDart for the frontend.
Reallife experiencewith DartViennaJS@Sgoettschkeshttps://stocksnap.io/photo/LTB7BB80VH
View Slide
blitzlichtImprove communication by asking simple questions.1. Ask one question2. Have people answer in their own words3. Get insights
blitzlicht in Action
Code example
Code exampleWebsockets
Code examplevoid connect(String url) {WebSocket.connect(url).then((WebSocket websocket) {websocket.pingInterval = new Duration(seconds: 5);websocket.listen(process, onDone: reconnect, onError: reconnect);});}
Code examplevoid process(String message) {Map data = JSON.decode(message);// ... do something}
Code exampleAPI
Code exampleimport 'package:redstone/redstone.dart' as app;void main() {app.start();}
Code example@app.Group('/api/blitzlichts')class BlitzlichtService {@app.Route('/:id')read(String id, @Repo() Repository repo) async {Blitzlicht blitzlicht =await repo.findOne(where.id(new ObjectId.fromHexString(id)));return blitzlicht.toMap();}}
Code exampleAngularDart
Code exampleimport 'package:angular2/platform/browser.dart';import 'package:blitzlicht/client/app_component.dart';void main() {bootstrap(AppComponent);}
Code example>
Code exampleLoading ...
Code example@Component(directives: const [ROUTER_DIRECTIVES],providers: const [ROUTER_PROVIDERS],selector: 'blitzlicht',templateUrl: 'app_component.html')@RouteConfig(const [const Route(path: '/', name: 'Index', component: IndexComponent, useAsDefault: true),])class AppComponent implements OnInit {Future ngOnInit() async {print('THIS IS BLITZLICHT');}}
Code exampleimport 'package:angular2/core.dart';import 'package:angular2/router.dart';@Component(directives: const [ROUTER_DIRECTIVES],selector: 'index',templateUrl: 'index_component.html')class IndexComponent {}
Summaryhttps://pixabay.com/en/milky-way-andromeda-stars-galaxy-923801/
https://www.dropbox.com/s/6z5aiwa8l09g2pa/86H.jpg