1

I hope you are doing great. I am trying to centralize an image at the level of the body using flutter but I instead receive this error: Error: No named parameter with the name 'body'. body: Center( .please what can I do to solve the issue? it is that the scaffold doesn't recognize body as widget? I am still a beginner . this is my code: void main() { runApp(MaterialApp( home: Scaffold( backgroundColor: Colors.blueGrey, appBar: AppBar( title: Center( child: Text('i am rich'), ), body: Center( child: Image( image: NetworkImage( 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS8-IFMk0FedZHVr-O9tluME2jy9-DXTV3TXA&usqp=CAU'), ), ), ), ), )); }

  • You are passing body to AppBar instead of the Scaffold, which is why it complains that AppBar does not support a body parameter – Nemi Shah Jun 06 '22 at 07:39

0 Answers0