Skip to content

Instantly share code, notes, and snippets.

View mplacona's full-sized avatar

Marcos Placona mplacona

View GitHub Profile
String toString() => '$value';
name: my_app
dependencies:
js: any
intl: any
// 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'); });
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', () {
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', () {
List<T> lst = new List<T>();
lst.add(1);
print(lst.first);
Future<Results> futureResults = costlyQuery();
futureResults.then((results) => renderTable(results));
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;
}
}
// 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);