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
<div id="div1"></div> | |
<br/> | |
<div id="div2"></div> | |
<br/> | |
<div id="div3"></div> | |
<br/> | |
<div id="div4"></div> |
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' show Future, Stream; | |
class SomeClass { | |
int _someValue; | |
void set someValue(int val) => | |
new Future.delayed(new Duration(milliseconds: 500), () => _someValue = val); | |
Future set someValue(int val) => | |
new Future.delayed(new Duration(milliseconds: 500), () => _someValue = val); |
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
// 29567236 | |
class Status { | |
static const off = const Status._(0); | |
static const on = const Status._(1); | |
final int value; | |
const Status._(this.value); | |
} | |
doSomething1([Status status = Status.off]) { |
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
// 29565067 | |
Map f = { | |
0 : 0, | |
1 : 1, | |
2 : 0, | |
3 : 1, | |
4 : 0, | |
5 : 1 | |
}; |
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'; | |
Stream<int> a() async* { | |
for (int i = 1; i <= 10; ++i) { | |
print('yield $i'); | |
yield i; | |
} | |
} | |
main() { |
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'; | |
class SqlResultSet { | |
List rows; | |
SqlResultSet(this.rows); | |
} | |
Future _runInTxn(txn(Transaction x)) { | |
print('_runInTxn'); | |
return new Future.value(txn(new Transaction())); |
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
// SO 29334843 | |
main() { | |
var a = new A()..doSomething(); | |
print('`a:` $a'); | |
var b = new B()..doSomething(); | |
print('`b:` $b'); | |
var c = new C()..doSomething(); | |
print('`c:` $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
// SO 29378453 | |
import 'dart:async'; | |
main() { | |
// fails | |
// main1(); | |
main2(); | |
main3(); | |
} |
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
// SO 29428637 | |
import 'dart:html' as dom; | |
const url = 'https://gist.githubusercontent.com/zoechi/a5170ff293b861b3db6b/raw/cf1332926cf9feb9d7463750a66df75571e6ab89/main.dart'; | |
main() async { | |
try { | |
final response = await dom.HttpRequest.getString(url); | |
print(response); | |
} catch(e) { |
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
// SO 29538557 | |
void main() { | |
List persons = []; | |
persons.add({'name': 'jhon', 'lastName': 'Doe'}); | |
print('before: $persons'); | |
persons.removeWhere((p) => p['name'] == 'jhon' && p['lastName'] == 'Doe'); | |
print('after: $persons'); | |
} |