Speed up development with full-stack environments for every branch.

Learn More

Very Small Silly Example of a Dart Expando

Forked from Basic Dart to JS Example.

355 Runs 562 Views 23 Copies
Saved

Saved

damondouglas 16

damondouglas
published 3 years ago

final data = new Expando<MyExpandoClass>();

void main() {
  
	var mc = new MyClass();
	var mc2 = new MyClass();
	
	data[mc] = new MyExpandoClass(1);
	data[mc2] = new MyExpandoClass(2);

	print(data[mc].foo);
	print(data[mc2].foo);

}

class MyClass {
	String name;
	String value;

}

class MyExpandoClass {
	int foo;
	MyExpandoClass(this.foo);
}
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).