gpt4 book ai didi

dart - 如果不适合侧面,如何在 Flutter 中将文本定位在图像下方?

转载 作者:IT王子 更新时间:2023-10-29 07:03:24 26 4
gpt4 key购买 nike

我不知道如何将列和行连接在一起,所以它在图像周围呈“L”形。

This is text. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This is text. XXXXXXXXXXXXXXXXimageXXXXXXXXXXXXXXXX
This is text. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This is text. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This is text.This is text.This is text.This is text.
This is text.This is text.This is text.This is text.
This is text.This is text.This is text.This is text.

最佳答案

您需要嵌套行和列。

例子:

     void main() => runApp(MyApp());

class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(),
);
}
}

class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Text"),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Column(
children: <Widget>[
Text(
'This is text.',
),
Text(
'This is text.',
),
Text(
'This is text.',
),
Text(
'This is text.',
),
Text(
'This is text.',
),
Text(
'This is text.',
),
],
),
Column(
children: <Widget>[
SizedBox(
width: 100,
height: 100,
child: Image.asset("assets/kitty-551554__340.jpg"),
),
Row(
children: <Widget>[
Column(
children: <Widget>[
Text(
'This is text.',
),
Text(
'This is text.',
),
],
),
Column(
children: <Widget>[
Text(
'This is text.',
),
Text(
'This is text.',
),
],
),
],
)
],
)
],
)
],
),
),
);
}
}

关于dart - 如果不适合侧面,如何在 Flutter 中将文本定位在图像下方?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56119502/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com