In this example, we have shared why is container width not honoured in Flutter. Flutter works, your Container doesn’t know the constraints of the Parent, then It try to fill all the space available.
You can fix it adding an Align Widget:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | _getCircleImage(String url) { return Align( alignment: Alignment.centerLeft, child: Container( width: 64.0, height: 64.0, decoration: new BoxDecoration( image: new DecorationImage( image: new NetworkImage(url), fit: BoxFit.cover, ), shape: BoxShape.circle, ), ), ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.