Flutter 容器内的多个文本
Flutter Multiple texts inside a Container
想知道如何在容器中实现这一点
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: width,
height: height / 3,
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 3,
),
),
),
也许这可以帮到你
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 3,
),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Text("a"),
Spacer(flex: 1,),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Text("a"),
Spacer(flex: 1,),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Text("a"),
Spacer(flex: 1,),
Text("B")
],
),
),
],
),
);
或
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 3,
),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("a"),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("a"),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("a"),
Text("B")
],
),
),
],
),
);
参数根据
设置
双向
查看下面的解决方案对您有帮助。
Column(
mainAxisAlignment: MainAxisAlignment.start,
children:[
Row(children:[
Text("Name"),Spacer(),Text("Abc")
]),
Row(children:[
Text("class"),Spacer(),Text("2nd")
])
])
想知道如何在容器中实现这一点
return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
width: width,
height: height / 3,
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 3,
),
),
),
也许这可以帮到你
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 3,
),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Text("a"),
Spacer(flex: 1,),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Text("a"),
Spacer(flex: 1,),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
Text("a"),
Spacer(flex: 1,),
Text("B")
],
),
),
],
),
);
或
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
border: Border.all(
color: Colors.black,
width: 3,
),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("a"),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("a"),
Text("B")
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("a"),
Text("B")
],
),
),
],
),
);
参数根据
设置双向
查看下面的解决方案对您有帮助。
Column(
mainAxisAlignment: MainAxisAlignment.start,
children:[
Row(children:[
Text("Name"),Spacer(),Text("Abc")
]),
Row(children:[
Text("class"),Spacer(),Text("2nd")
])
])