| enum E { | |
| one(1), | |
| two(2); | |
| final int foo; | |
| final int bar = 42; | |
| static E staticFoo = new E.f(); | |
| const E(this.foo); | |
| factory E.f() => E.one; | |
| int method(int value) => value + 10; | |
| String staticMethod(double d, bool b) => "$d$b"; | |
| } | |
| enum E2<X> { | |
| one<num>(1), | |
| two("2"); | |
| final X foo; | |
| final X? bar = null; | |
| static var staticFoo = () => new E2.f(); | |
| const E2(this.foo); | |
| factory E2.f() => throw 42; | |
| int method(int value) => value + 10; | |
| String staticMethod(double d, X x) => "$d$x"; | |
| } | |
| main() {} |