Hello everyone, I've been analyzing the answers they gave me in issue #33104 33104, and I'll summarize them in a single proposal, which I consider a necessity and the most important, since the translation is not exact, I'll explain it with a couple of examples:
class CounterState extends State<Counter> {
private int counter = 0;
private void increment() {
setState(() {
this.counter++;
});
}
private void decrement() {
setState(() {
this.counter--;
});
}
public Widget build(BuildContext context) {
return new Row(
children: <Widget>[
new RaisedButton(
onPressed: this.increment,
child: new Text('Increment'),
),
new RaisedButton(
onPressed: this.decrement,
child: new Text('Decrement'),
),
new Text('Count: $counter'),
],
);
}
}
class Person {
private String firstName;
private String lastName;
private int age;
Person(this.firstName, this.lastName, this.age);
public Map<String, dynamic> asMap() {
return {
'firstName': this.firstName,
'lastName': this.lastName,
'age': this.age
};
}
String get firstName => this.firstName;
String get lastName => this.lastName;
int get age => this.age;
}
void main() {
final Person x = new Person("Brayan", "Martinez", 23);
print(x.firstName)
print(x.asMap().toString());
}
- I hope you like this new version, and can convince them, what remains is to decearle the greatest possible success.
Hello everyone, I've been analyzing the answers they gave me in issue #33104 33104, and I'll summarize them in a single proposal, which I consider a necessity and the most important, since the translation is not exact, I'll explain it with a couple of examples:
The proposal is: Add the reserved word public and private only.
An example with flutter.