2021年4月4日星期日

How to customizing alignment to components inside a Row on Flutter?

I'm building a Card to show a image and some text information. I want that RED Container content align to top and not the center like current. I'm using a Row to divide the Image and Texts contents. Besides that I want change the position of Texts on whole space at the right of image, so how I can manage it?

Card Widget

  Widget buildExerciseCard(BuildContext context, int index) {      return Container(        color: Colors.green,        margin: EdgeInsets.fromLTRB(5, 2, 5, 0),        child: Card(            color: Colors.blue,            child: Row(              mainAxisSize: MainAxisSize.min,              children: [                Image.asset(                  exerciseList[index].imagePath,                  width: 75,                  height: 75,                  fit: BoxFit.contain,                ),                Container(                  color: Colors.red,                  child: Column(                    children: [                      Text(exerciseList[index].name),                      Text(exerciseList[index].bodyPart),                      Text(exerciseList[index].muscle)                    ],                  ),                ),              ],            )),      );    }  

Result: enter image description here

https://stackoverflow.com/questions/66947186/how-to-customizing-alignment-to-components-inside-a-row-on-flutter April 05, 2021 at 09:05AM

没有评论:

发表评论