positional parameters by fatdragon2
Find this at dartpad.dartlang.org/?source=802a495c-49eb-468a-9b63-f669c4815720.
Created with <3 with dartpad.dartlang.org.
positional parameters by fatdragon2
Find this at dartpad.dartlang.org/?source=802a495c-49eb-468a-9b63-f669c4815720.
Created with <3 with dartpad.dartlang.org.
// positional parameters by fatdragon2 | |
say({String from, | |
String msg : "good morning america", | |
String device, | |
String version : '7'}) | |
{ | |
var result = '$from says $msg'; | |
if (device != null) { | |
result = '$result with a $device ${version != null ? version : ""}'; | |
} | |
print(result); | |
} | |
void main() { | |
say(from: 'tom', msg: 'hello world', device: 'iPhone', version: '7'); | |
} |