Skip to content

Commit

Permalink
[!] 添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
wjun94 committed Aug 1, 2019
1 parent c8b7dfa commit 1f825e2
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions lib/tap_water_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,31 @@ class NavigationIconView {
}

class WaterTabBar extends StatefulWidget {
/// 是否有加号按钮
final bool isButton;

/// 是否有加号按钮
/// appBar Widget
final Widget appBar;

/// appBar Widget
/// 主体内容
final Widget body;

/// body Widget
/// 底部按钮配置
List<NavigationIconView> btmNavbar = [];
final Function onTabClick;

/// 组件通信
final Function onTabClick;

/// 底部button选中颜色
final Color selectedColor;

/// +号按钮选中颜色
final Color buttonSelectedColor;

/// +号按钮索引
int btnIndex;

/// btmNavbar数组长度
int len;
WaterTabBar(
{Key key,
Expand Down Expand Up @@ -69,13 +78,15 @@ class WaterTabBar extends StatefulWidget {
}

class _WaterTabBarState extends State<WaterTabBar> {
/// 选中的索引
int _activeIndex = 0;
/// +号按钮背景色
Color _addBgc = Colors.grey;

@override
Widget build(BuildContext context) {
var _items = BottomNavigationBar(
// 底部导航栏
/// 底部导航栏
items: widget.btmNavbar
.map((NavigationIconView navigationIconView) =>
navigationIconView.item)
Expand Down Expand Up @@ -109,6 +120,7 @@ class _WaterTabBarState extends State<WaterTabBar> {
);
}

/// 单击事件
void _onTabClick(int index) {
if (widget.isButton) {
if (index == widget.len + 1) {
Expand Down

0 comments on commit 1f825e2

Please sign in to comment.