Why does this work:
class Person extends StatelessWidget {
final String name;
Person({ this.name });
...
}
but the following gives an error ('_name' can't be used as a setter because it is final.
Try finding a different setter, or making name' non-final.
):
class Person extends StatelessWidget {
final String _name;
Person({ name }) {
this._name = name;
}
...
}
Is this: ({ this.name })
doing something different under the hood?