Skip to content

Commit

Permalink
Use List.filled constructor instead of soon-to-be-deprecated List con…
Browse files Browse the repository at this point in the history
…structor (flutter#22925)
  • Loading branch information
aam authored Dec 8, 2020
1 parent 5db0780 commit a90d587
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion testing/dart/encoding_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class Square4x4Image {

static List<int> get bytes {
const int bytesPerChannel = 4;
final List<int> result = List<int>(_kWidth * _kWidth * bytesPerChannel);
final List<int> result = List<int>.filled(
_kWidth * _kWidth * bytesPerChannel, 0);

void fillWithColor(Color color, int min, int max) {
for (int i = min; i < max; i++) {
Expand Down

0 comments on commit a90d587

Please sign in to comment.