Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace tip 16 code image
  • Loading branch information
EsteveAguilera committed Nov 10, 2020
commit 132843f1cc76c564e2e10b7216ee4fdffd24174a
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,35 @@ If you have been declaring each member separately all the time, you can declare
I wouldn't declare `age` and `shoeSize` at once because they are not related.

With great power comes great responsibility, Use this wisely.
![singleline](assets/16singlelinedeclartion.png)

```dart
class Footballer {

String firstName = "Lionel";
String middleName = "Andrés";
String lastName = "Messi";

double weightKG;
double heightCM;

int goals;
int assists;
int tackles;
int takeons;
int saves;
int shots;
}

// The class above can be replaced with:
class Footballer {

String firstName = "Lionel", middleName = "Andrés", lastName = "Messi";

double weightKG, heightCM;

int goals, assists, tackles, takeons, saves, shots;
}
```

## Tip 17 : SliverAppBar / Collapsable AppBar / ParallaxHeader

Expand Down
Binary file removed assets/16singlelinedeclartion.png
Binary file not shown.