admin管理员组文章数量:1417555
How to wrap text around the Icon as the text will drop under the icon as its height is more than that of the icon. In the below image, text should be under the icon from fourth line
I've tried wrapping it Expanded and Flex, Better if no hard coded customizations.
How to wrap text around the Icon as the text will drop under the icon as its height is more than that of the icon. In the below image, text should be under the icon from fourth line
I've tried wrapping it Expanded and Flex, Better if no hard coded customizations.
Share Improve this question asked Jan 31 at 9:31 ShanuShanu 6671 gold badge5 silver badges28 bronze badges 2- 2 It's more involved that it seems. I recommend having a look at the pub.dev package: float_column. – Dan R Commented Jan 31 at 9:57
- Assuming the text data won't be coming from API, A workaround would be to use Stack widget and add many empty text "" before the lorem ipsum string. Would you like the code for it? – Ali Jawad Commented Jan 31 at 15:29
2 Answers
Reset to default 1I believe you are looking for something similar to CSS's float. There is a package called float_column. This should solve your issue, implement it as such:
FloatColumn(
children: [
const Floatable(
float: FCFloat.start,
child: Icon(
Icons.info,
size: 50.0,
)
),
WrappableText(text: TextSpan(text: loremIpsum))
],
),
In the example, your icon will be included inside the floatable widget, which is provided by the package itself. Your text should be wrapped by the WrappableText
widget. Also don't fet to set the float parameter to the Floatable widget as per your need, your example requires the FCFloat.start
.
The result will be:
checkout drop_cap_text
package here is the demo
enter image description here
DropCapText(
loremIpsumText,
dropCap: DropCap(
width: 100,
height: 100,
child: Imagework(
'https://www.codemate/wp-content/uploads/2017/09/flutter-logo.png')
),
),
本文标签: flutterHow to wrap text around a widgetStack Overflow
版权声明:本文标题:flutter - How to wrap text around a widget - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745271814a2650938.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论