简体   繁体   中英

what to use instead of title widget in vs code

BottomNavigationBarItem(icon: Icon(Icons.access_alarm),title: Text("first")), vs code editor said

"message": "'title' is deprecated and shouldn't be used. Use \"label\" instead, as it allows for an improved text-scaling experience. This feature was deprecated after v1.19.0..\nTry replacing the use of the deprecated member with the replacement.",
"source": "dart",
"startLineNumber": 25,
"startColumn": 68,
"endLineNumber": 25,
"endColumn": 73,
"tags": [
    2
]

}]

Use "label" widget instead of "title"

BottomNavigationBarItem(
                      icon: Icon(Icons.add),
                      label: "Hello",
                    )

你应该使用像 BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home', ) 这样的 'label'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM