例如在PHP中,
$key1 = 'name';
$key2 = 'mobile';
$person = new Person();
$person->{$key1} = 'Ahmad';
$person->{$mobile} = '60148220678';
如何用Flutter(Dart语言)实现?我尝试过
var key1 = 'name';
Person _person = new Person();
_person.{key1} = 'Ahmad';
但是它显示了错误