This file contains hidden or 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 'dart:async'; | |
| import 'package:http/http.dart' as http; | |
| import 'package:html/parser.dart' as parser; | |
| import 'package:html/dom.dart'; | |
| main() async { | |
| http.Response response = await http.get('https://news.ycombinator.com/'); | |
| Document document = parser.parse(response.body); | |
This file contains hidden or 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 'package:http/http.dart' as http; | |
| import 'package:html/parser.dart' as parser; | |
| import 'package:html/dom.dart'; | |
| main() async { | |
| http.Response response = await http.get('https://news.ycombinator.com/'); | |
| Document document = parser.parse(response.body); | |
| document.getElementsByTagName('a').forEach((Element element){ |
This file contains hidden or 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 'package:xmlstream/xmlstream.dart'; | |
| import 'dart:io'; | |
| main() { | |
| XmlStreamer xmlStreamer = new XmlStreamer.fromStream(new File('BigXMLFile.xml').openRead()); | |
| xmlStreamer.read().listen((XmlEvent event){ | |
| print(event); | |
| }); | |
| } |
This file contains hidden or 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 'dart:isolate'; | |
| //This is the worker | |
| void worker(SendPort request) { | |
| ReceivePort response = new ReceivePort(); | |
| request.send(response.sendPort); | |
| response.listen((message){ | |
| print("Boss: $message"); | |
| request.send("...."); | |
| response.close(); |