Created with <3 with dartpad.dev.
Created
July 27, 2022 13:13
-
-
Save afucher/b7795b6e431c8d4be41a22a895d577d6 to your computer and use it in GitHub Desktop.
divine-spray-6506
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 Foo { | |
final String? p1; | |
const Foo({ | |
this.p1 = "default" | |
}); | |
} | |
void main() { | |
const foo1 = Foo(); | |
print(foo1.p1); | |
final foo2 = Foo(p1: "no default"); | |
print(foo2.p1); | |
final foo3 = Foo(p1: null); | |
print(foo3.p1); | |
final Map<Symbol, dynamic> namedArgs = {}; | |
final foo4 = Function.apply(Foo.new, null, namedArgs); | |
print(foo4.p1); | |
namedArgs[#p1] = "apply value"; | |
final foo5 = Function.apply(Foo.new, null, namedArgs); | |
print(foo5.p1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment