移除 `InputDecoration.collapsed` 的無效參數
摘要
#InputDecoration.collapsed
的無效參數 floatingLabelBehavior
和 floatingLabelAlignment
已被棄用。
背景
#InputDecoration.collapsed
建構子用於建立沒有標籤的最小裝飾。
參數 floatingLabelAlignment
和 floatingLabelBehavior
沒有效果,因為使用 InputDecoration.collapsed
建立的輸入裝飾沒有標籤。
遷移指南
#要進行遷移,請在呼叫 InputDecoration.collapsed
建構子時,移除 floatingLabelBehavior
和 floatingLabelAlignment
參數的使用。這些參數沒有任何效果。
遷移前的程式碼
dart
InputDecoration.collapsed(
hintText: 'Hint',
floatingLabelAlignment: FloatingLabelAlignment.center,
floatingLabelBehavior: FloatingLabelBehavior.auto,
),
遷移後的程式碼
dart
InputDecoration.collapsed(
hintText: 'Hint',
),
時間軸
#已於版本中實裝:v3.24.0-0.1.pre
在穩定版本中:尚未推出
參考資料
#API 文件
InputDecoration.collapsed
InputDecoration.floatingLabelAlignment
InputDecoration.floatingLabelBehavior
相關議題
相關 PR
除非另有說明,否則本網站上的文件反映了 Flutter 的最新穩定版本。頁面最後更新於 2024-08-06。 檢視原始碼 或 回報問題。