Flutter

小白学Flutter - Button两种颜色

2023-11-19  本文已影响0人  林希品
效果图
TextButton(
                  onPressed: () {
                    // 处理按钮点击事件
                    print('Button Clicked');
                  },
                  child: RichText(
                    text: const TextSpan(
                      children: <TextSpan>[
                        TextSpan(
                          text: '没有账号?',
                          style: TextStyle(
                            color: MColors.colorFF999999, // 使用十六进制颜色代码设置文本颜色
                            fontWeight: FontWeight.bold, // 可以添加其他样式
                          ),
                        ),
                        TextSpan(
                          text: '立即注册',
                          style: TextStyle(
                            color: MColors.colorAPP, // 使用十六进制颜色代码设置文本颜色
                            fontWeight: FontWeight.normal, // 可以添加其他样式
                          ),
                        ),
                      ],
                    ),
                  ),
                )
上一篇 下一篇

猜你喜欢

热点阅读