unnecessary_this工具 chevron_right診斷 chevron_rightunnecessary_this 目錄描述示例常見修復方法 toggle_on Linter 規則不必要的 'this.' 限定符。描述#當使用關鍵字 this 訪問未被 shadowing 的成員時,分析器會生成此診斷。示例#以下程式碼會生成此診斷,因為使用 this 訪問欄位 _f 是不必要的dartclass C { int _f = 2; int get f => this._f; }常見修復方法#移除 this.dartclass C { int _f = 2; int get f => _f; }此頁面內容有幫助嗎?thumb_up thumb_down感謝您的反饋! feedback 提供詳情感謝您的反饋!請告知我們如何改進。 bug_report 提供詳情除非另有說明,本網站文件反映 Dart 3.8.1 版本。頁面最後更新於 2025-05-08。 檢視原始碼 或 報告問題。