目录
flutter最近火起来了,相信他能干什么事,想必大家都知道,这里就不累赘了,直接上干货吧。。
源码解读
Flutter源码看起来括号嵌套括号,感觉很恐怖,其实你仔细的看没有那么难:每个产品都有自己的主题,为了避免我们每次都要写appbar,我们把它抽离出去。
- APPbar的源码 ,我把源码贴出来,首先构造方法里面出现了“{}”这玩意,“{}”就代表这些参数不是必传的,你可以根据自己的需求选择;
AppBar({
Key key,
this.leading,
this.automaticallyImplyLeading = true,
this.title,
this.actions,
this.flexibleSpace,
this.bottom,
this.elevation,
this.shape,
this.backgroundColor,
this.brightness,
this.iconTheme,
this.actionsIconTheme,
this.textTheme,
this.primary = true,
this.centerTitle,
this.titleSpacing = NavigationToolbar.kMiddleSpacing,
this.toolbarOpacity = 1.0,
this.bottomOpacity = 1.0,
})
想这些参数,代表什么意思,怎么用,大家如果不会了,直接点击去看源码,都有解释,用法也有