copy method

  1. @override
Square copy()
override

It's a method that returns a copy of the current shape.

Implementation

@override
Square copy() => Square.fromList(
      grid.map((List<int> e) => <int>[...e]).toList(),
    );