07-21-2023, 12:10 PM
New to flutter, can some one tells me whats wrong with below code[![enter image description here][1]][1]
class GamePage extends StatelessWidget {
int _row;
int _column;
GamePage(this._row,this._column);
@override
Widget build(BuildContext context) {
return new Material(
color: Colors.deepPurpleAccent,
child:new Expanded(
child:new GridView.count(crossAxisCount: _column,children: new List.generate(_row*_column, (index) {
return new Center(
child: new CellWidget()
);
}),) )
);
}
}
Attaching error screenshot.
[1]:
class GamePage extends StatelessWidget {
int _row;
int _column;
GamePage(this._row,this._column);
@override
Widget build(BuildContext context) {
return new Material(
color: Colors.deepPurpleAccent,
child:new Expanded(
child:new GridView.count(crossAxisCount: _column,children: new List.generate(_row*_column, (index) {
return new Center(
child: new CellWidget()
);
}),) )
);
}
}
Attaching error screenshot.
[1]: