Icon(
data.icon,
color: Colors.red,
),
/// 根据当前页面是否选中...类型 , 主要用于控制 PageView 的页面跳转 ;
滑动回调事件 : onPageChanged 参数设置滑动回调事件 , 传入 index 索引值 , 在该事件中 , 调用 setState..._currentIndex = index;
});
},
/// Widget 组件数组 , 设置多个 Widget 组件
/// 同一时间只显示一个页面组件
children...= index;
});
},
}
PageView 被动设置选中状态 : 在 BottomNavigationBar 底部导航栏中点击导航按钮 , 切换页面 , 使用 PageView...Icon(
data.icon,
color: Colors.red,
),
/// 根据当前页面是否选中