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 'dart:convert'; | |
import 'dart:collection'; | |
import 'dart:typed_data'; | |
main() { | |
var str = '12345☺'; | |
var bytes = UTF8.encode(str); | |
print(decodeUtf8Slice(bytes, 5, 3)); | |
print(decodeUtf8Slice(bytes, 5)); | |
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 'package:observe/observe.dart'; | |
class ObsTest extends Observable { | |
@observable int x; | |
void xChanged(c) { | |
print('xChanged: $c'); | |
} |
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 'dart:async'; | |
import 'dart:convert'; | |
import 'dart:io'; | |
import 'dart:typed_data'; | |
const SPLIT_SENTINEL = const [42]; | |
class Splitter extends Converter<List<int>, List<List<int>>> { | |
Splitter(this._splitOnByte); |
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 'dart:async'; | |
import 'dart:chrome'; | |
import 'dart:html'; | |
import 'package:js/js.dart' as js; | |
void main() { | |
var open = new ButtonElement()..text = 'Open'; | |
document.body.children.add(open); | |
write(s) => document.body.children.add(new DivElement()..text = s); |
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
Create the files shown below, make sure dart-sdk/bin is in your path and run: | |
pub install | |
This will fetch the source for the postgresql library, and put it in a sub-directory called packages. | |
Then run the program: | |
dart main.dart |