How to set the width of a Container based on the length of its child Text? Flutter
问题 I am Trying to develop a chat app and I am trying to display the text messages inside a container and set the width according to the length of the message. How can I set the width according to the length of a String? P.S messages are displayed using listview.builder and each container has a background color. ListView.builder( padding: EdgeInsets.only(top: 8.0, left: 15.0, right: 15.0), itemCount: messages.length, itemBuilder: (context, index) { return Container( padding: EdgeInsets.all(20.0),