[英]How to change TextButton text color in Flutter
如何更改 flutter 中的默認 TextButton 文本顏色這是我的代碼
TextButton(onPressed: null, child: Text('Add Item'))
如果您不使用主題,只需將樣式屬性添加到 Text 構造函數
TextButton(onPressed: null, child: Text('Add Item',
style: TextStyle(color: Colors.purple)))
如果您在 main.dart 文件中使用默認主題,那么它將選擇強調顏色,或者您也可以手動提供
TextButton(onPressed: null, child: Text('Add Item',
style: TextStyle(color: Theme.of(context).accentColor)))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.