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
String toString() => '$value'; |
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
name: my_app | |
dependencies: | |
js: any | |
intl: any |
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
pub get |
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
// Simple Map & Iteration program | |
void main(){ | |
Map cache = { | |
'Homepage': '<h1>Swanky Homepage</h1>', | |
'Contact': '<h1>Talk to me baby</h1>', | |
'About': '<h1>I\'m a legend</h1>' | |
}; | |
// And obviously you can iterato through it | |
cache.forEach((k, v) { print('$k, $v'); }); |
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:unittest/unittest.dart'; | |
void main() { | |
Map cache = { | |
'Homepage': '<h1>Swanky Homepage</h1>', | |
'Contact': '<h1>Talk to me baby</h1>', | |
'About': '<h1>I\'m a legend</h1>' | |
}; | |
test('cached homepage', () { |
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:unittest/unittest.dart'; | |
void main() { | |
Map cache = { | |
'Homepage': '<h1>Swanky Homepage</h1>', | |
'Contact': '<h1>Talk to me baby</h1>', | |
'About': '<h1>I\'m a legend</h1>' | |
}; | |
group('Cached homepage', () { |
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
List<T> lst = new List<T>(); | |
lst.add(1); | |
print(lst.first); |
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
Future<Results> futureResults = costlyQuery(); | |
futureResults.then((results) => renderTable(results)); |
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
class Flake{ | |
double _x, _y, _r, _d; | |
Flake(double x, double y, double r, double d){ | |
this._x = x; | |
this._y = y; | |
this._r = r; | |
this._d = d; | |
} | |
} |
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
// Holds all my flakes | |
var flakes = []; | |
// Maximum number of flakes at a time, and speed in which they fall | |
const int maxFlakes= 100; //max number of flakes | |
const int speed = 5; // snowfall speed | |
// Duration of the animation | |
const thirtyMills = const Duration(milliseconds:30); | |