gpt4 book ai didi

flutter - 无法在 flutter 中使用 BottomNavigationBar 的项目属性

转载 作者:IT王子 更新时间:2023-10-29 07:14:29 27 4
gpt4 key购买 nike

我正在尝试在我的 flutter 项目中使用 BottomNavigationBar 并且我想向它提供项目。为此,我必须使用 items 属性。但是我无法在 BottomNavigationBar 中找到 items 属性。请看附图。

enter image description here

完整代码如下:

class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance
// as done by the _incrementCounter method above.
// The Flutter framework has been optimized to make rerunning
// build methods fast, so that you can just rebuild anything that
// needs updating rather than having to individually change
// instances of widgets.
return new Scaffold(
appBar: new AppBar(
// Here we take the value from the MyHomePage object that
// was created by the App.build method, and use it to set
// our appbar title.
title: new Text(config.title),
),
bottomNavigationBar: new BottomNavigationBar(
currentIndex: 0,
onTap: (value){

},
),
// a style that looks nicer for build methods.
);
}
}

最佳答案

你确定你有最新版本的flutter吗?据我所知,目标标签已切换到 2016 年 12 月提交的项目: https://github.com/flutter/flutter/commit/1b9939af9547513061d2e30716f182b490f5362b#diff-f907c739b721784b11a7fec0459d384f

关于flutter - 无法在 flutter 中使用 BottomNavigationBar 的项目属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46133602/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com