当前位置:网站首页>Shutter wrap button bottomnavigationbar learning summary 4
Shutter wrap button bottomnavigationbar learning summary 4
2022-06-10 14:12:00 【tnan2522】
Wrap
Wrap It is a component of flow layout , take children The components in the component list are arranged in rows , When a line can't fit , Wrap The rest of the components will flow to the next line for layout , Such as 
You can see , If you can't fit a line , Wrap The rest will be automatically placed on the next line for layout
How alignment This can be done as the last component in a row , You can also start with the component , It can also be automatically , In the figure, the method of automatic adjustment is used
RaisedButton
Button components , Can pass RaisedButton Generate button , Click the button to listen for click events onPressed
When the button is clicked , This listener function will be called ,
You can also set data in the click to listen function , however , Button needs to be in StatefulWidget Can only be used in stateful components setState Function to update component data

You can see , stay this.lists When the data content changes , stay StatefulWidget Medium Listview The displayed content page will refresh , This is it. StatefulWidget Functions of stateful components
bottomNavigationBar
stay Scaffold Bottom navigation buttons can be set in , You can set the bottom navigation button to jump to the page , Button settings
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed, // When the bottom navigation button exceeds 3 When it's time
// There will be bug, The bottom navigation will be covered with white , Can pass type Set it up , So it can be displayed normally
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home), title: Text(" home page ")), // There is... At the bottom 3 More than buttons
// when There will be bug,
BottomNavigationBarItem(
icon: Icon(Icons.wallpaper), title: Text(" classification ")),
BottomNavigationBarItem(
icon: Icon(Icons.settings), title: Text(" Set up ")),
BottomNavigationBarItem(
icon: Icon(Icons.my_location), title: Text(" my ")),
]),
),
items Is an array of button components ,

You can see , When the number of buttons exceeds 3 When it's time , The bottom button will be covered with white , therefore , And that's where it comes in type The attribute is ,
type: BottomNavigationBarType.fixed
When you set type Properties can be displayed normally
One of the bottom buttons onTap function , When you click the bottom button, it will trigger the letter , This function takes in a int Parameters of type , This parameter receives items The subscript of the button corresponding to the button list , There is also a button at the bottom currentIndex Properties of , Used to select the corresponding subscript ,
First record a subscript in the button class , The default is 0, When you click onTap When , Get the subscript of the click button , And then in setState Function to replace the subscript of the record button , In this way, you can click the button to switch functions
Switch the display page by clicking the button at the bottom
This is very simple , on top import To other users' files , Then use a list to store these pages , Click on the bottom button num When things change ,body It will also change with life 
边栏推荐
- [technical analysis] discuss the production process and technology of big world games - preliminary process
- 2022 Shandong Province safety officer C certificate retraining question bank and online simulation examination
- [solution] each time the trained model is loaded, the generated vector will be different
- [advanced MySQL] optimize SQL by using the execution plan explain (2)
- Microsoft Word tutorial, how to change margins and create a newsletter column in word?
- Adding, deleting, modifying and querying databases with JDBC
- [discrete mathematics review series] III. concept and operation of sets
- C # list of shallow copy and deep copy customized classes <>
- Microsoft Word 教程,如何在 Word 中更改页边距、创建新闻稿栏?
- Flutter Listview, Column, Row学习个人总结2
猜你喜欢

Flutter 页面跳转 传参,TabBar学习总结5

Mutual transformation among lists, arrays and tensors

How to solve the problem that vmware tools are grayed out when VMware Workstation is installed

Do you understand all these difficult memory problems?

New features mail GPU counter module adds GPU primitive processing and GPU shader cycles

基于FPGA的VGA协议实现

一次主从表集成流程开发过程

【离散数学期复习系列】三、集合的概念及运算

What is CAS and ABA in CAS

北京/上海内推 | 微软亚洲研究院系统与网络组招聘全职实习生
随机推荐
How to solve the problem that vmware tools are grayed out when VMware Workstation is installed
什么是CAS 以及 CAS 中的 ABA 问题
【离散数学期复习系列】三、集合的概念及运算
【离散数学期复习系列】二、一阶逻辑(谓词逻辑)
【离散数学期复习系列】四、图
About native SQL and database methods in PHP framework
【离散数学期复习系列】五、一些特殊的图
C#多线程学习笔记四
【离散数学期复习系列】六、树
[notes] some records of 74hc573
Is it safe to open an account in qiniu
CentOS Linux 已死!Oracle Linux 可能是它的更好替代品
[advanced MySQL] optimize SQL by using the execution plan explain (2)
解决安装gerapy的时候报错:ERROR: Cannot uninstall ‘certifi‘. It is a distutils installed project...
架构实战营 第 6 期 模块八课后作业
P3379 [template] nearest common ancestor (LCA)
Flutter drawer学习总结6
Kotlin bubbling algorithm, Gaud map filters out the data whose distance between two points is less than 50, and does not repeat the display
618. How to prepare for the great promotion
QT 基于QScrollArea的界面嵌套移动