我得到的错误是:
"无法将参数类型" TextSpan "赋给参数类型" List?"
下面是代码:
Widget buildSignUpBtn() {
return GestureDetector(
onTap: () => print('SignUp Pressed'),
child: RichText(
text: TextSpan(
children: TextSpan(
text: 'Don\'t have an Account',
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
TextSpan(
text: 'Don\'t have an Account',
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
),
),
),
);
}
请帮我解决这个问题!
1条答案
按热度按时间y1aodyip1#
它在children属性中获取TextSpan列表,如下所示:
您可以在官方文档here中阅读有关RichText的更多信息