File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,21 @@ class SnowFlakeAnimation extends BadgeAnimation {
9
9
List <List <bool >> processGrid,
10
10
List <List <bool >> canvas,
11
11
) {
12
+ if (processGrid.isEmpty ||
13
+ processGrid.any ((row) => row.length != processGrid[0 ].length)) {
14
+ throw ArgumentError (
15
+ 'processGrid must be a non-empty rectangular 2D list' ,
16
+ );
17
+ }
12
18
int newGridHeight = processGrid.length;
13
19
int newGridWidth = processGrid[0 ].length;
14
20
21
+ if (canvas.length < badgeHeight ||
22
+ canvas.any ((row) => row.length < badgeWidth)) {
23
+ throw ArgumentError (
24
+ 'canvas must have at least $badgeHeight rows and $badgeWidth columns' ,
25
+ );
26
+ }
15
27
int framesCount = (newGridWidth / badgeWidth).ceil ();
16
28
framesCount = framesCount == 0 ? 1 : framesCount;
17
29
You can’t perform that action at this time.
0 commit comments